home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Tape Archive
(archive/tar).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Tape Archive (archive/tar)
| magic
| Supported |
1%
| dexvert
| Application Techniques Pizazz compressed (archive/PizazzCompressed)
| ext
| Unsupported |
100%
| file
| POSIX tar archive (GNU)
| default
| |
99%
| file
| POSIX tar archive (GNU), directory sag-0.3/, mode 40755 , uid 5761 , gid 5670 , size 0 , seconds 6011167577, user wirzeniu, group grpc
| default
| |
98%
| file
| data
| default
| |
62%
| TrID
| TAR - Tape ARchive (GNU)
| default
| |
37%
| TrID
| TAR - Tape ARchive (directory)
| default
| |
100%
| dearkID
| deark: tar
| default
| |
100%
| siegfried
| x-fmt/265 Tape Archive Format
| default
| |
100%
| lsar
| Tar
| default (weak)
| |
100%
| gt2
| TAR Archiv gefunden (Auflistung ist deaktiviert)
| default
| |
100%
| disktype
| GNU tar archive
| default
| |
100%
| detectItEasy
| Archive: tar
| default
| |
100%
| binwalkID
| POSIX tar archive (GNU)
| default
| |
100%
| xdgMime
| application/x-tar
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 73 61 67 2d 30 2e 33 2f | 00 00 00 00 00 00 00 00 |sag-0.3/|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 34 30 37 | 35 35 20 00 20 20 35 37 |.... 407|55 . 57|
|00000070| 36 31 20 00 20 20 35 36 | 37 30 20 00 20 20 20 20 |61 . 56|70 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 36 30 31 31 31 36 37 | 0 | 6011167|
|00000090| 35 37 37 20 20 31 31 31 | 37 30 00 20 35 00 00 00 |577 111|70. 5...|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 75 73 74 61 72 20 20 | 00 77 69 72 7a 65 6e 69 |.ustar |.wirzeni|
|00000110| 75 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |u.......|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 67 72 70 63 00 00 00 |........|.grpc...|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 73 61 67 2d 30 2e 33 2f | 65 78 74 32 66 73 2f 00 |sag-0.3/|ext2fs/.|
|00000210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 20 34 30 37 | 35 35 20 00 20 20 35 37 |.... 407|55 . 57|
|00000270| 36 31 20 00 20 20 35 36 | 37 30 20 00 20 20 20 20 |61 . 56|70 . |
|00000280| 20 20 20 20 20 20 30 20 | 20 36 30 31 30 34 32 35 | 0 | 6010425|
|00000290| 31 32 32 20 20 31 32 33 | 36 31 00 20 35 00 00 00 |122 123|61. 5...|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 75 73 74 61 72 20 20 | 00 77 69 72 7a 65 6e 69 |.ustar |.wirzeni|
|00000310| 75 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |u.......|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 67 72 70 63 00 00 00 |........|.grpc...|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 73 61 67 2d 30 2e 33 2f | 65 78 74 32 66 73 2f 70 |sag-0.3/|ext2fs/p|
|00000410| 61 70 65 72 2e 74 65 78 | 00 00 00 00 00 00 00 00 |aper.tex|........|
|00000420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000460| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 35 37 |....1006|44 . 57|
|00000470| 36 31 20 00 20 20 35 36 | 37 30 20 00 20 20 20 20 |61 . 56|70 . |
|00000480| 20 31 31 33 33 36 33 20 | 20 36 30 31 30 32 31 33 | 113363 | 6010213|
|00000490| 35 31 37 20 20 31 34 33 | 36 31 00 20 30 00 00 00 |517 143|61. 0...|
|000004a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000500| 00 75 73 74 61 72 20 20 | 00 77 69 72 7a 65 6e 69 |.ustar |.wirzeni|
|00000510| 75 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |u.......|........|
|00000520| 00 00 00 00 00 00 00 00 | 00 67 72 70 63 00 00 00 |........|.grpc...|
|00000530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000600| 25 20 2d 2a 2d 6c 61 74 | 65 78 2d 2a 2d 0a 25 0a |% -*-lat|ex-*-.%.|
|00000610| 25 0a 25 25 25 20 5c 64 | 6f 63 75 6d 65 6e 74 73 |%.%%% \d|ocuments|
|00000620| 74 79 6c 65 20 5b 31 31 | 70 74 2c 61 34 2c 65 70 |tyle [11|pt,a4,ep|
|00000630| 73 66 2c 72 63 6e 61 6d | 65 64 2c 72 65 6d 79 2c |sf,rcnam|ed,remy,|
|00000640| 74 77 6f 63 6f 6c 75 6d | 6e 5d 20 7b 61 72 74 69 |twocolum|n] {arti|
|00000650| 63 6c 65 7d 0a 5c 69 6e | 70 75 74 7b 65 78 74 32 |cle}.\in|put{ext2|
|00000660| 66 73 2f 72 65 6d 79 2e | 73 74 79 7d 0a 0a 5c 6e |fs/remy.|sty}..\n|
|00000670| 65 77 63 6f 6d 6d 61 6e | 64 20 7b 5c 6d 79 69 74 |ewcomman|d {\myit|
|00000680| 65 6d 7d 20 7b 5c 76 73 | 70 61 63 65 20 7b 2d 33 |em} {\vs|pace {-3|
|00000690| 6d 6d 7d 20 5c 69 74 65 | 6d 7d 0a 0a 25 25 25 5c |mm} \ite|m}..%%%\|
|000006a0| 62 65 67 69 6e 20 7b 64 | 6f 63 75 6d 65 6e 74 7d |begin {d|ocument}|
|000006b0| 0a 5c 63 68 61 70 74 65 | 72 7b 44 65 73 69 67 6e |.\chapte|r{Design|
|000006c0| 20 61 6e 64 20 49 6d 70 | 6c 65 6d 65 6e 74 61 74 | and Imp|lementat|
|000006d0| 69 6f 6e 20 6f 66 20 74 | 68 65 20 53 65 63 6f 6e |ion of t|he Secon|
|000006e0| 64 20 45 78 74 65 6e 64 | 65 64 20 46 69 6c 65 73 |d Extend|ed Files|
|000006f0| 79 73 74 65 6d 7d 0a 5c | 6c 61 62 65 6c 7b 63 68 |ystem}.\|label{ch|
|00000700| 61 70 3a 65 78 74 32 66 | 73 70 61 70 65 72 7d 0a |ap:ext2f|spaper}.|
|00000710| 0a 54 68 69 73 20 61 70 | 70 65 6e 64 69 78 20 69 |.This ap|pendix i|
|00000720| 73 20 61 20 70 61 70 65 | 72 20 77 72 69 74 74 65 |s a pape|r writte|
|00000730| 6e 20 62 79 20 52 5c 27 | 65 6d 79 20 43 61 72 64 |n by R\'|emy Card|
|00000740| 20 28 5c 74 65 78 74 74 | 74 7b 63 61 72 64 40 6d | (\textt|t{card@m|
|00000750| 61 73 69 2e 69 62 70 2e | 66 72 7d 29 2c 0a 54 68 |asi.ibp.|fr}),.Th|
|00000760| 65 6f 64 6f 72 65 20 54 | 73 27 6f 20 28 5c 74 65 |eodore T|s'o (\te|
|00000770| 78 74 74 74 7b 74 79 74 | 73 6f 40 6d 69 74 2e 65 |xttt{tyt|so@mit.e|
|00000780| 64 75 7d 29 2c 20 61 6e | 64 20 53 74 65 70 68 65 |du}), an|d Stephe|
|00000790| 6e 20 54 77 65 65 64 69 | 65 0a 28 5c 74 65 78 74 |n Tweedi|e.(\text|
|000007a0| 74 74 7b 73 63 74 40 64 | 63 73 2e 65 64 2e 61 63 |tt{sct@d|cs.ed.ac|
|000007b0| 2e 75 6b 7d 29 2c 20 74 | 68 65 20 64 65 73 69 67 |.uk}), t|he desig|
|000007c0| 6e 65 72 73 0a 61 6e 64 | 20 69 6d 70 6c 65 6d 65 |ners.and| impleme|
|000007d0| 6e 74 6f 72 73 20 6f 66 | 20 74 68 65 20 65 78 74 |ntors of| the ext|
|000007e0| 32 20 66 69 6c 65 73 79 | 73 74 65 6d 2e 20 20 49 |2 filesy|stem. I|
|000007f0| 74 20 77 61 73 20 66 69 | 72 73 74 20 70 75 62 6c |t was fi|rst publ|
|00000800| 69 73 68 65 64 20 69 6e | 20 74 68 65 0a 50 72 6f |ished in| the.Pro|
|00000810| 63 65 65 64 69 6e 67 73 | 20 6f 66 20 74 68 65 20 |ceedings| of the |
|00000820| 46 69 72 73 74 20 44 75 | 74 63 68 20 49 6e 74 65 |First Du|tch Inte|
|00000830| 72 6e 61 74 69 6f 6e 61 | 6c 20 53 79 6d 70 6f 73 |rnationa|l Sympos|
|00000840| 69 75 6d 20 6f 6e 20 4c | 69 6e 75 78 2c 0a 49 53 |ium on L|inux,.IS|
|00000850| 42 4e 20 39 30 20 33 36 | 37 20 30 33 38 35 20 39 |BN 90 36|7 0385 9|
|00000860| 2e 0a 0a 25 25 25 20 5c | 74 69 74 6c 65 20 20 7b |...%%% \|title {|
|00000870| 44 65 73 69 67 6e 20 61 | 6e 64 20 49 6d 70 6c 65 |Design a|nd Imple|
|00000880| 6d 65 6e 74 61 74 69 6f | 6e 20 6f 66 20 74 68 65 |mentatio|n of the|
|00000890| 20 53 65 63 6f 6e 64 20 | 45 78 74 65 6e 64 65 64 | Second |Extended|
|000008a0| 20 46 69 6c 65 73 79 73 | 74 65 6d 7d 0a 25 25 25 | Filesys|tem}.%%%|
|000008b0| 20 5c 61 75 74 68 6f 72 | 20 7b 52 5c 27 65 6d 79 | \author| {R\'emy|
|000008c0| 20 43 61 72 64 5c 74 68 | 61 6e 6b 73 20 7b 4c 61 | Card\th|anks {La|
|000008d0| 62 6f 72 61 74 6f 69 72 | 65 20 4d 41 53 49 20 2d |boratoir|e MASI -|
|000008e0| 2d 2d 20 49 6e 73 74 69 | 74 75 74 20 42 6c 61 69 |-- Insti|tut Blai|
|000008f0| 73 65 20 50 61 73 63 61 | 6c 2c 0a 09 25 25 25 20 |se Pasca|l,..%%% |
|00000900| 45 2d 4d 61 69 6c 3a 20 | 63 61 72 64 40 6d 61 73 |E-Mail: |card@mas|
|00000910| 69 2e 69 62 70 2e 66 72 | 7d 20 5c 61 6e 64 0a 09 |i.ibp.fr|} \and..|
|00000920| 25 25 25 20 54 68 65 6f | 64 6f 72 65 20 54 73 27 |%%% Theo|dore Ts'|
|00000930| 6f 5c 74 68 61 6e 6b 73 | 20 7b 4d 61 73 73 61 63 |o\thanks| {Massac|
|00000940| 68 75 73 73 65 74 73 20 | 49 6e 73 74 69 74 75 74 |hussets |Institut|
|00000950| 65 20 6f 66 20 54 65 63 | 68 6e 6f 6c 6f 67 79 2c |e of Tec|hnology,|
|00000960| 0a 09 25 25 25 20 45 2d | 4d 61 69 6c 3a 20 74 79 |..%%% E-|Mail: ty|
|00000970| 74 73 6f 40 6d 69 74 2e | 65 64 75 7d 20 5c 61 6e |tso@mit.|edu} \an|
|00000980| 64 0a 09 25 25 25 20 53 | 74 65 70 68 65 6e 20 54 |d..%%% S|tephen T|
|00000990| 77 65 65 64 69 65 5c 74 | 68 61 6e 6b 73 20 7b 55 |weedie\t|hanks {U|
|000009a0| 6e 69 76 65 72 73 69 74 | 79 20 6f 66 20 45 64 69 |niversit|y of Edi|
|000009b0| 6e 62 75 72 67 68 2c 0a | 09 25 25 25 20 45 2d 4d |nburgh,.|.%%% E-M|
|000009c0| 61 69 6c 3a 20 73 63 74 | 40 64 63 73 2e 65 64 2e |ail: sct|@dcs.ed.|
|000009d0| 61 63 2e 75 6b 7d 0a 09 | 25 25 25 20 7d 0a 25 25 |ac.uk}..|%%% }.%%|
|000009e0| 25 20 5c 64 61 74 65 20 | 20 20 7b 7d 0a 0a 25 25 |% \date | {}..%%|
|000009f0| 25 20 5c 6d 61 6b 65 74 | 69 74 6c 65 0a 0a 5c 72 |% \maket|itle..\r|
|00000a00| 61 67 67 65 64 62 6f 74 | 74 6f 6d 0a 0a 5c 73 65 |aggedbot|tom..\se|
|00000a10| 63 74 69 6f 6e 2a 20 7b | 49 6e 74 72 6f 64 75 63 |ction* {|Introduc|
|00000a20| 74 69 6f 6e 7d 0a 0a 09 | 4c 69 6e 75 78 20 69 73 |tion}...|Linux is|
|00000a30| 20 61 20 55 6e 69 78 2d | 6c 69 6b 65 20 6f 70 65 | a Unix-|like ope|
|00000a40| 72 61 74 69 6e 67 20 73 | 79 73 74 65 6d 2c 20 77 |rating s|ystem, w|
|00000a50| 68 69 63 68 20 72 75 6e | 73 20 6f 6e 20 50 43 2d |hich run|s on PC-|
|00000a60| 33 38 36 20 63 6f 6d 70 | 75 74 65 72 73 2e 0a 49 |386 comp|uters..I|
|00000a70| 74 20 77 61 73 20 69 6d | 70 6c 65 6d 65 6e 74 65 |t was im|plemente|
|00000a80| 64 20 66 69 72 73 74 20 | 61 73 20 65 78 74 65 6e |d first |as exten|
|00000a90| 73 69 6f 6e 20 74 6f 20 | 74 68 65 20 4d 69 6e 69 |sion to |the Mini|
|00000aa0| 78 20 6f 70 65 72 61 74 | 69 6e 67 20 73 79 73 74 |x operat|ing syst|
|00000ab0| 65 6d 0a 5c 63 69 74 65 | 20 7b 6d 69 6e 69 78 7d |em.\cite| {minix}|
|00000ac0| 20 61 6e 64 0a 69 74 73 | 20 66 69 72 73 74 20 76 | and.its| first v|
|00000ad0| 65 72 73 69 6f 6e 73 20 | 69 6e 63 6c 75 64 65 64 |ersions |included|
|00000ae0| 20 73 75 70 70 6f 72 74 | 20 66 6f 72 20 74 68 65 | support| for the|
|00000af0| 20 4d 69 6e 69 78 20 66 | 69 6c 65 73 79 73 74 65 | Minix f|ilesyste|
|00000b00| 6d 20 6f 6e 6c 79 2e 20 | 54 68 65 20 4d 69 6e 69 |m only. |The Mini|
|00000b10| 78 0a 66 69 6c 65 73 79 | 73 74 65 6d 20 63 6f 6e |x.filesy|stem con|
|00000b20| 74 61 69 6e 73 20 74 77 | 6f 20 73 65 72 69 6f 75 |tains tw|o seriou|
|00000b30| 73 20 6c 69 6d 69 74 61 | 74 69 6f 6e 73 3a 20 62 |s limita|tions: b|
|00000b40| 6c 6f 63 6b 20 61 64 64 | 72 65 73 73 65 73 20 61 |lock add|resses a|
|00000b50| 72 65 20 73 74 6f 72 65 | 64 20 69 6e 0a 31 36 20 |re store|d in.16 |
|00000b60| 62 69 74 20 69 6e 74 65 | 67 65 72 73 2c 20 74 68 |bit inte|gers, th|
|00000b70| 75 73 20 74 68 65 20 6d | 61 78 69 6d 61 6c 20 66 |us the m|aximal f|
|00000b80| 69 6c 65 73 79 73 74 65 | 6d 20 73 69 7a 65 20 69 |ilesyste|m size i|
|00000b90| 73 20 72 65 73 74 72 69 | 63 74 65 64 20 74 6f 20 |s restri|cted to |
|00000ba0| 36 34 20 6d 65 67 61 0a | 62 79 74 65 73 2c 20 61 |64 mega.|bytes, a|
|00000bb0| 6e 64 20 64 69 72 65 63 | 74 6f 72 69 65 73 20 63 |nd direc|tories c|
|00000bc0| 6f 6e 74 61 69 6e 20 66 | 69 78 65 64 2d 73 69 7a |ontain f|ixed-siz|
|00000bd0| 65 20 65 6e 74 72 69 65 | 73 20 61 6e 64 20 74 68 |e entrie|s and th|
|00000be0| 65 20 6d 61 78 69 6d 61 | 6c 20 66 69 6c 65 20 6e |e maxima|l file n|
|00000bf0| 61 6d 65 0a 69 73 20 31 | 34 20 63 68 61 72 61 63 |ame.is 1|4 charac|
|00000c00| 74 65 72 73 2e 0a 0a 09 | 57 65 20 68 61 76 65 20 |ters....|We have |
|00000c10| 64 65 73 69 67 6e 65 64 | 20 61 6e 64 20 69 6d 70 |designed| and imp|
|00000c20| 6c 65 6d 65 6e 74 65 64 | 20 74 77 6f 20 6e 65 77 |lemented| two new|
|00000c30| 20 66 69 6c 65 73 79 73 | 74 65 6d 73 20 74 68 61 | filesys|tems tha|
|00000c40| 74 20 61 72 65 0a 69 6e | 63 6c 75 64 65 64 20 69 |t are.in|cluded i|
|00000c50| 6e 20 74 68 65 20 73 74 | 61 6e 64 61 72 64 20 4c |n the st|andard L|
|00000c60| 69 6e 75 78 20 6b 65 72 | 6e 65 6c 2e 20 54 68 65 |inux ker|nel. The|
|00000c70| 73 65 0a 66 69 6c 65 73 | 79 73 74 65 6d 73 2c 20 |se.files|ystems, |
|00000c80| 63 61 6c 6c 65 64 20 60 | 60 45 78 74 65 6e 64 65 |called `|`Extende|
|00000c90| 64 20 46 69 6c 65 20 53 | 79 73 74 65 6d 27 27 20 |d File S|ystem'' |
|00000ca0| 28 45 78 74 20 66 73 29 | 20 61 6e 64 0a 60 60 53 |(Ext fs)| and.``S|
|00000cb0| 65 63 6f 6e 64 20 45 78 | 74 65 6e 64 65 64 20 46 |econd Ex|tended F|
|00000cc0| 69 6c 65 20 53 79 73 74 | 65 6d 27 27 20 28 45 78 |ile Syst|em'' (Ex|
|00000cd0| 74 32 20 66 73 29 20 72 | 61 69 73 65 20 74 68 65 |t2 fs) r|aise the|
|00000ce0| 20 6c 69 6d 69 74 61 74 | 69 6f 6e 73 0a 61 6e 64 | limitat|ions.and|
|00000cf0| 20 61 64 64 20 6e 65 77 | 20 66 65 61 74 75 72 65 | add new| feature|
|00000d00| 73 2e 0a 0a 09 49 6e 20 | 74 68 69 73 20 70 61 70 |s....In |this pap|
|00000d10| 65 72 2c 20 77 65 20 64 | 65 73 63 72 69 62 65 20 |er, we d|escribe |
|00000d20| 74 68 65 20 68 69 73 74 | 6f 72 79 20 6f 66 20 4c |the hist|ory of L|
|00000d30| 69 6e 75 78 20 66 69 6c | 65 73 79 73 74 65 6d 73 |inux fil|esystems|
|00000d40| 2e 20 57 65 0a 62 72 69 | 65 66 6c 79 20 69 6e 74 |. We.bri|efly int|
|00000d50| 72 6f 64 75 63 65 20 74 | 68 65 20 66 75 6e 64 61 |roduce t|he funda|
|00000d60| 6d 65 6e 74 61 6c 20 63 | 6f 6e 63 65 70 74 73 20 |mental c|oncepts |
|00000d70| 69 6d 70 6c 65 6d 65 6e | 74 65 64 20 69 6e 20 55 |implemen|ted in U|
|00000d80| 6e 69 78 20 66 69 6c 65 | 73 79 73 74 65 6d 73 2e |nix file|systems.|
|00000d90| 0a 57 65 20 70 72 65 73 | 65 6e 74 20 74 68 65 20 |.We pres|ent the |
|00000da0| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 20 6f |implemen|tation o|
|00000db0| 66 20 74 68 65 20 56 69 | 72 74 75 61 6c 20 46 69 |f the Vi|rtual Fi|
|00000dc0| 6c 65 20 53 79 73 74 65 | 6d 20 6c 61 79 65 72 20 |le Syste|m layer |
|00000dd0| 69 6e 20 4c 69 6e 75 78 | 20 61 6e 64 0a 77 65 20 |in Linux| and.we |
|00000de0| 64 65 74 61 69 6c 20 74 | 68 65 20 53 65 63 6f 6e |detail t|he Secon|
|00000df0| 64 20 45 78 74 65 6e 64 | 65 64 20 46 69 6c 65 20 |d Extend|ed File |
|00000e00| 53 79 73 74 65 6d 20 6b | 65 72 6e 65 6c 20 63 6f |System k|ernel co|
|00000e10| 64 65 20 61 6e 64 20 75 | 73 65 72 20 6d 6f 64 65 |de and u|ser mode|
|00000e20| 20 74 6f 6f 6c 73 2e 0a | 4c 61 73 74 2c 20 77 65 | tools..|Last, we|
|00000e30| 20 70 72 65 73 65 6e 74 | 20 70 65 72 66 6f 72 6d | present| perform|
|00000e40| 61 6e 63 65 20 6d 65 61 | 73 75 72 65 6d 65 6e 74 |ance mea|surement|
|00000e50| 73 20 6d 61 64 65 20 6f | 6e 20 4c 69 6e 75 78 20 |s made o|n Linux |
|00000e60| 61 6e 64 20 42 53 44 20 | 66 69 6c 65 73 79 73 74 |and BSD |filesyst|
|00000e70| 65 6d 73 0a 61 6e 64 20 | 77 65 20 63 6f 6e 63 6c |ems.and |we concl|
|00000e80| 75 64 65 20 77 69 74 68 | 20 74 68 65 20 63 75 72 |ude with| the cur|
|00000e90| 72 65 6e 74 20 73 74 61 | 74 75 73 20 6f 66 20 45 |rent sta|tus of E|
|00000ea0| 78 74 32 66 73 20 61 6e | 64 20 74 68 65 20 66 75 |xt2fs an|d the fu|
|00000eb0| 74 75 72 65 20 64 69 72 | 65 63 74 69 6f 6e 73 2e |ture dir|ections.|
|00000ec0| 0a 0a 5c 73 65 63 74 69 | 6f 6e 20 7b 48 69 73 74 |..\secti|on {Hist|
|00000ed0| 6f 72 79 20 6f 66 20 4c | 69 6e 75 78 20 66 69 6c |ory of L|inux fil|
|00000ee0| 65 73 79 73 74 65 6d 73 | 7d 0a 5c 6c 61 62 65 6c |esystems|}.\label|
|00000ef0| 20 7b 73 65 63 74 69 6f | 6e 3a 68 69 73 74 6f 72 | {sectio|n:histor|
|00000f00| 79 7d 0a 0a 09 49 6e 20 | 69 74 73 20 76 65 72 79 |y}...In |its very|
|00000f10| 20 65 61 72 6c 79 20 64 | 61 79 73 2c 20 4c 69 6e | early d|ays, Lin|
|00000f20| 75 78 20 77 61 73 20 63 | 72 6f 73 73 2d 64 65 76 |ux was c|ross-dev|
|00000f30| 65 6c 6f 70 65 64 20 75 | 6e 64 65 72 20 74 68 65 |eloped u|nder the|
|00000f40| 20 4d 69 6e 69 78 0a 6f | 70 65 72 61 74 69 6e 67 | Minix.o|perating|
|00000f50| 20 73 79 73 74 65 6d 2e | 20 49 74 20 77 61 73 20 | system.| It was |
|00000f60| 65 61 73 69 65 72 20 74 | 6f 20 73 68 61 72 65 20 |easier t|o share |
|00000f70| 64 69 73 6b 73 20 62 65 | 74 77 65 65 6e 20 74 68 |disks be|tween th|
|00000f80| 65 20 74 77 6f 20 73 79 | 73 74 65 6d 73 20 74 68 |e two sy|stems th|
|00000f90| 61 6e 0a 74 6f 20 64 65 | 73 69 67 6e 20 61 20 6e |an.to de|sign a n|
|00000fa0| 65 77 20 66 69 6c 65 73 | 79 73 74 65 6d 2c 20 73 |ew files|ystem, s|
|00000fb0| 6f 20 4c 69 6e 75 73 20 | 54 6f 72 76 61 6c 64 73 |o Linus |Torvalds|
|00000fc0| 20 64 65 63 69 64 65 64 | 20 74 6f 20 69 6d 70 6c | decided| to impl|
|00000fd0| 65 6d 65 6e 74 20 73 75 | 70 70 6f 72 74 0a 66 6f |ement su|pport.fo|
|00000fe0| 72 20 74 68 65 20 4d 69 | 6e 69 78 20 66 69 6c 65 |r the Mi|nix file|
|00000ff0| 73 79 73 74 65 6d 20 69 | 6e 20 4c 69 6e 75 78 2e |system i|n Linux.|
|00001000| 20 54 68 65 20 4d 69 6e | 69 78 20 66 69 6c 65 73 | The Min|ix files|
|00001010| 79 73 74 65 6d 20 77 61 | 73 20 61 6e 20 65 66 66 |ystem wa|s an eff|
|00001020| 69 63 69 65 6e 74 0a 61 | 6e 64 20 72 65 6c 61 74 |icient.a|nd relat|
|00001030| 69 76 65 6c 79 20 62 75 | 67 2d 66 72 65 65 20 70 |ively bu|g-free p|
|00001040| 69 65 63 65 20 6f 66 20 | 73 6f 66 74 77 61 72 65 |iece of |software|
|00001050| 2e 0a 0a 09 48 6f 77 65 | 76 65 72 2c 20 74 68 65 |....Howe|ver, the|
|00001060| 20 72 65 73 74 72 69 63 | 74 69 6f 6e 73 20 69 6e | restric|tions in|
|00001070| 20 74 68 65 20 64 65 73 | 69 67 6e 20 6f 66 20 74 | the des|ign of t|
|00001080| 68 65 20 4d 69 6e 69 78 | 0a 66 69 6c 65 73 79 73 |he Minix|.filesys|
|00001090| 74 65 6d 20 77 65 72 65 | 20 74 6f 6f 20 6c 69 6d |tem were| too lim|
|000010a0| 69 74 69 6e 67 2c 20 73 | 6f 20 70 65 6f 70 6c 65 |iting, s|o people|
|000010b0| 20 73 74 61 72 74 65 64 | 20 74 68 69 6e 6b 69 6e | started| thinkin|
|000010c0| 67 20 61 6e 64 20 77 6f | 72 6b 69 6e 67 20 6f 6e |g and wo|rking on|
|000010d0| 0a 74 68 65 20 69 6d 70 | 6c 65 6d 65 6e 74 61 74 |.the imp|lementat|
|000010e0| 69 6f 6e 20 6f 66 20 6e | 65 77 20 66 69 6c 65 73 |ion of n|ew files|
|000010f0| 79 73 74 65 6d 73 20 69 | 6e 20 4c 69 6e 75 78 2e |ystems i|n Linux.|
|00001100| 0a 0a 09 49 6e 20 6f 72 | 64 65 72 20 74 6f 20 65 |...In or|der to e|
|00001110| 61 73 65 20 74 68 65 20 | 61 64 64 69 74 69 6f 6e |ase the |addition|
|00001120| 20 6f 66 20 6e 65 77 20 | 66 69 6c 65 73 79 73 74 | of new |filesyst|
|00001130| 65 6d 73 20 69 6e 74 6f | 0a 74 68 65 20 4c 69 6e |ems into|.the Lin|
|00001140| 75 78 20 6b 65 72 6e 65 | 6c 2c 20 61 20 56 69 72 |ux kerne|l, a Vir|
|00001150| 74 75 61 6c 20 46 69 6c | 65 20 53 79 73 74 65 6d |tual Fil|e System|
|00001160| 20 28 56 46 53 29 20 6c | 61 79 65 72 20 77 61 73 | (VFS) l|ayer was|
|00001170| 20 64 65 76 65 6c 6f 70 | 65 64 2e 20 20 54 68 65 | develop|ed. The|
|00001180| 20 56 46 53 0a 6c 61 79 | 65 72 20 77 61 73 20 69 | VFS.lay|er was i|
|00001190| 6e 69 74 69 61 6c 6c 79 | 20 77 72 69 74 74 65 6e |nitially| written|
|000011a0| 20 62 79 20 43 68 72 69 | 73 20 50 72 6f 76 65 6e | by Chri|s Proven|
|000011b0| 7a 61 6e 6f 2c 20 61 6e | 64 20 6c 61 74 65 72 20 |zano, an|d later |
|000011c0| 72 65 77 72 69 74 74 65 | 6e 20 62 79 0a 4c 69 6e |rewritte|n by.Lin|
|000011d0| 75 73 20 54 6f 72 76 61 | 6c 64 73 20 62 65 66 6f |us Torva|lds befo|
|000011e0| 72 65 20 69 74 20 77 61 | 73 20 69 6e 74 65 67 72 |re it wa|s integr|
|000011f0| 61 74 65 64 20 69 6e 74 | 6f 20 74 68 65 20 4c 69 |ated int|o the Li|
|00001200| 6e 75 78 20 6b 65 72 6e | 65 6c 2e 20 20 49 74 20 |nux kern|el. It |
|00001210| 77 69 6c 6c 0a 62 65 20 | 64 65 73 63 72 69 62 65 |will.be |describe|
|00001220| 64 20 69 6e 20 73 65 63 | 74 69 6f 6e 7e 5c 72 65 |d in sec|tion~\re|
|00001230| 66 20 7b 73 65 63 74 69 | 6f 6e 3a 76 66 73 7d 20 |f {secti|on:vfs} |
|00001240| 6f 66 20 74 68 69 73 20 | 70 61 70 65 72 2e 0a 0a |of this |paper...|
|00001250| 09 41 66 74 65 72 20 74 | 68 65 20 69 6e 74 65 67 |.After t|he integ|
|00001260| 72 61 74 69 6f 6e 20 6f | 66 20 74 68 65 20 56 46 |ration o|f the VF|
|00001270| 53 20 69 6e 20 74 68 65 | 20 6b 65 72 6e 65 6c 2c |S in the| kernel,|
|00001280| 20 61 20 6e 65 77 20 66 | 69 6c 65 73 79 73 74 65 | a new f|ilesyste|
|00001290| 6d 2c 0a 63 61 6c 6c 65 | 64 20 74 68 65 20 60 60 |m,.calle|d the ``|
|000012a0| 45 78 74 65 6e 64 65 64 | 20 46 69 6c 65 20 53 79 |Extended| File Sy|
|000012b0| 73 74 65 6d 27 27 20 77 | 61 73 20 69 6d 70 6c 65 |stem'' w|as imple|
|000012c0| 6d 65 6e 74 65 64 20 69 | 6e 20 41 70 72 69 6c 20 |mented i|n April |
|000012d0| 31 39 39 32 0a 61 6e 64 | 20 61 64 64 65 64 20 74 |1992.and| added t|
|000012e0| 6f 20 4c 69 6e 75 78 20 | 30 2e 39 36 63 2e 20 54 |o Linux |0.96c. T|
|000012f0| 68 69 73 20 6e 65 77 20 | 66 69 6c 65 73 79 73 74 |his new |filesyst|
|00001300| 65 6d 20 72 65 6d 6f 76 | 65 64 20 74 68 65 20 74 |em remov|ed the t|
|00001310| 77 6f 20 62 69 67 20 4d | 69 6e 69 78 0a 6c 69 6d |wo big M|inix.lim|
|00001320| 69 74 61 74 69 6f 6e 73 | 3a 20 69 74 73 20 6d 61 |itations|: its ma|
|00001330| 78 69 6d 61 6c 20 73 69 | 7a 65 20 77 61 73 20 32 |ximal si|ze was 2|
|00001340| 20 67 69 67 61 20 62 79 | 74 65 73 20 61 6e 64 20 | giga by|tes and |
|00001350| 74 68 65 20 6d 61 78 69 | 6d 61 6c 20 66 69 6c 65 |the maxi|mal file|
|00001360| 20 6e 61 6d 65 0a 73 69 | 7a 65 20 77 61 73 20 32 | name.si|ze was 2|
|00001370| 35 35 20 63 68 61 72 61 | 63 74 65 72 73 2e 20 49 |55 chara|cters. I|
|00001380| 74 20 77 61 73 20 61 6e | 20 69 6d 70 72 6f 76 65 |t was an| improve|
|00001390| 6d 65 6e 74 20 6f 76 65 | 72 20 74 68 65 20 4d 69 |ment ove|r the Mi|
|000013a0| 6e 69 78 20 66 69 6c 65 | 73 79 73 74 65 6d 20 62 |nix file|system b|
|000013b0| 75 74 0a 73 6f 6d 65 20 | 70 72 6f 62 6c 65 6d 73 |ut.some |problems|
|000013c0| 20 77 65 72 65 20 73 74 | 69 6c 6c 20 70 72 65 73 | were st|ill pres|
|000013d0| 65 6e 74 20 69 6e 20 69 | 74 2e 20 54 68 65 72 65 |ent in i|t. There|
|000013e0| 20 77 61 73 20 6e 6f 20 | 73 75 70 70 6f 72 74 20 | was no |support |
|000013f0| 66 6f 72 20 74 68 65 0a | 73 65 70 61 72 61 74 65 |for the.|separate|
|00001400| 20 61 63 63 65 73 73 2c | 20 69 6e 6f 64 65 20 6d | access,| inode m|
|00001410| 6f 64 69 66 69 63 61 74 | 69 6f 6e 2c 20 61 6e 64 |odificat|ion, and|
|00001420| 20 64 61 74 61 20 6d 6f | 64 69 66 69 63 61 74 69 | data mo|dificati|
|00001430| 6f 6e 20 74 69 6d 65 73 | 74 61 6d 70 73 2e 20 54 |on times|tamps. T|
|00001440| 68 65 0a 66 69 6c 65 73 | 79 73 74 65 6d 20 75 73 |he.files|ystem us|
|00001450| 65 64 20 6c 69 6e 6b 65 | 64 20 6c 69 73 74 73 20 |ed linke|d lists |
|00001460| 74 6f 20 6b 65 65 70 20 | 74 72 61 63 6b 20 6f 66 |to keep |track of|
|00001470| 20 66 72 65 65 20 62 6c | 6f 63 6b 73 20 61 6e 64 | free bl|ocks and|
|00001480| 20 69 6e 6f 64 65 73 20 | 61 6e 64 0a 74 68 69 73 | inodes |and.this|
|00001490| 20 70 72 6f 64 75 63 65 | 64 20 62 61 64 20 70 65 | produce|d bad pe|
|000014a0| 72 66 6f 72 6d 61 6e 63 | 65 73 3a 20 61 73 20 74 |rformanc|es: as t|
|000014b0| 68 65 20 66 69 6c 65 73 | 79 73 74 65 6d 20 77 61 |he files|ystem wa|
|000014c0| 73 20 75 73 65 64 2c 20 | 74 68 65 20 6c 69 73 74 |s used, |the list|
|000014d0| 73 20 62 65 63 61 6d 65 | 0a 75 6e 73 6f 72 74 65 |s became|.unsorte|
|000014e0| 64 20 61 6e 64 20 74 68 | 65 20 66 69 6c 65 73 79 |d and th|e filesy|
|000014f0| 73 74 65 6d 20 62 65 63 | 61 6d 65 20 66 72 61 67 |stem bec|ame frag|
|00001500| 6d 65 6e 74 65 64 2e 0a | 0a 09 41 73 20 61 20 72 |mented..|..As a r|
|00001510| 65 73 70 6f 6e 73 65 20 | 74 6f 20 74 68 65 73 65 |esponse |to these|
|00001520| 20 70 72 6f 62 6c 65 6d | 73 2c 20 74 77 6f 20 6e | problem|s, two n|
|00001530| 65 77 20 66 69 6c 65 73 | 79 74 65 6d 73 20 77 65 |ew files|ytems we|
|00001540| 72 65 20 72 65 6c 65 61 | 73 65 64 0a 69 6e 20 41 |re relea|sed.in A|
|00001550| 6c 70 68 61 20 76 65 72 | 73 69 6f 6e 20 69 6e 20 |lpha ver|sion in |
|00001560| 4a 61 6e 75 61 72 79 20 | 31 39 39 33 3a 20 74 68 |January |1993: th|
|00001570| 65 20 58 69 61 20 66 69 | 6c 65 73 79 73 74 65 6d |e Xia fi|lesystem|
|00001580| 20 61 6e 64 20 74 68 65 | 20 53 65 63 6f 6e 64 20 | and the| Second |
|00001590| 45 78 74 65 6e 64 65 64 | 0a 46 69 6c 65 20 53 79 |Extended|.File Sy|
|000015a0| 73 74 65 6d 2e 20 54 68 | 65 20 58 69 61 20 66 69 |stem. Th|e Xia fi|
|000015b0| 6c 65 73 79 73 74 65 6d | 20 77 61 73 20 68 65 61 |lesystem| was hea|
|000015c0| 76 69 6c 79 20 62 61 73 | 65 64 20 6f 6e 20 74 68 |vily bas|ed on th|
|000015d0| 65 20 4d 69 6e 69 78 20 | 66 69 6c 65 73 79 73 74 |e Minix |filesyst|
|000015e0| 65 6d 0a 6b 65 72 6e 65 | 6c 20 63 6f 64 65 20 61 |em.kerne|l code a|
|000015f0| 6e 64 20 6f 6e 6c 79 20 | 61 64 64 65 64 20 61 20 |nd only |added a |
|00001600| 66 65 77 20 69 6d 70 72 | 6f 76 65 6d 65 6e 74 73 |few impr|ovements|
|00001610| 20 6f 76 65 72 20 74 68 | 69 73 20 66 69 6c 65 73 | over th|is files|
|00001620| 79 73 74 65 6d 2e 20 42 | 61 73 69 63 61 6c 6c 79 |ystem. B|asically|
|00001630| 2c 0a 69 74 20 70 72 6f | 76 69 64 65 64 20 6c 6f |,.it pro|vided lo|
|00001640| 6e 67 20 66 69 6c 65 20 | 6e 61 6d 65 73 2c 20 73 |ng file |names, s|
|00001650| 75 70 70 6f 72 74 20 66 | 6f 72 20 62 69 67 67 65 |upport f|or bigge|
|00001660| 72 20 70 61 72 74 69 74 | 69 6f 6e 73 20 61 6e 64 |r partit|ions and|
|00001670| 20 73 75 70 70 6f 72 74 | 20 66 6f 72 0a 74 68 65 | support| for.the|
|00001680| 20 74 68 72 65 65 20 74 | 69 6d 65 73 74 61 6d 70 | three t|imestamp|
|00001690| 73 2e 20 4f 6e 20 74 68 | 65 20 6f 74 68 65 72 20 |s. On th|e other |
|000016a0| 68 61 6e 64 2c 20 45 78 | 74 32 66 73 20 77 61 73 |hand, Ex|t2fs was|
|000016b0| 20 62 61 73 65 64 20 6f | 6e 20 74 68 65 20 45 78 | based o|n the Ex|
|000016c0| 74 66 73 20 63 6f 64 65 | 0a 77 69 74 68 0a 6d 61 |tfs code|.with.ma|
|000016d0| 6e 79 20 72 65 6f 72 67 | 61 6e 69 7a 61 74 69 6f |ny reorg|anizatio|
|000016e0| 6e 73 20 61 6e 64 20 6d | 61 6e 79 20 69 6d 70 72 |ns and m|any impr|
|000016f0| 6f 76 65 6d 65 6e 74 73 | 2e 20 49 74 20 68 61 64 |ovements|. It had|
|00001700| 20 62 65 65 6e 20 64 65 | 73 69 67 6e 65 64 20 77 | been de|signed w|
|00001710| 69 74 68 20 65 76 6f 6c | 75 74 69 6f 6e 0a 69 6e |ith evol|ution.in|
|00001720| 20 6d 69 6e 64 20 61 6e | 64 20 63 6f 6e 74 61 69 | mind an|d contai|
|00001730| 6e 65 64 20 73 70 61 63 | 65 20 66 6f 72 20 66 75 |ned spac|e for fu|
|00001740| 74 75 72 65 20 69 6d 70 | 72 6f 76 65 6d 65 6e 74 |ture imp|rovement|
|00001750| 73 2e 20 49 74 20 77 69 | 6c 6c 20 62 65 20 64 65 |s. It wi|ll be de|
|00001760| 73 63 72 69 62 65 64 20 | 77 69 74 68 0a 6d 6f 72 |scribed |with.mor|
|00001770| 65 20 64 65 74 61 69 6c | 73 20 69 6e 20 73 65 63 |e detail|s in sec|
|00001780| 74 69 6f 6e 7e 5c 72 65 | 66 20 7b 73 65 63 74 69 |tion~\re|f {secti|
|00001790| 6f 6e 3a 65 78 74 32 66 | 73 7d 2e 0a 0a 09 57 68 |on:ext2f|s}....Wh|
|000017a0| 65 6e 20 74 68 65 20 74 | 77 6f 20 6e 65 77 20 66 |en the t|wo new f|
|000017b0| 69 6c 65 73 79 73 74 65 | 6d 73 20 77 65 72 65 20 |ilesyste|ms were |
|000017c0| 66 69 72 73 74 20 72 65 | 6c 65 61 73 65 64 2c 20 |first re|leased, |
|000017d0| 74 68 65 79 0a 70 72 6f | 76 69 64 65 64 20 65 73 |they.pro|vided es|
|000017e0| 73 65 6e 74 69 61 6c 6c | 79 20 74 68 65 20 73 61 |sentiall|y the sa|
|000017f0| 6d 65 20 66 65 61 74 75 | 72 65 73 2e 20 44 75 65 |me featu|res. Due|
|00001800| 20 74 6f 20 69 74 73 20 | 6d 69 6e 69 6d 61 6c 20 | to its |minimal |
|00001810| 64 65 73 69 67 6e 2c 0a | 58 69 61 20 66 73 20 77 |design,.|Xia fs w|
|00001820| 61 73 20 6d 6f 72 65 20 | 73 74 61 62 6c 65 20 74 |as more |stable t|
|00001830| 68 61 6e 20 45 78 74 32 | 66 73 2e 0a 41 73 20 74 |han Ext2|fs..As t|
|00001840| 68 65 20 66 69 6c 65 73 | 79 73 74 65 6d 73 20 77 |he files|ystems w|
|00001850| 65 72 65 20 75 73 65 64 | 20 6d 6f 72 65 20 77 69 |ere used| more wi|
|00001860| 64 65 6c 79 2c 20 62 75 | 67 73 20 77 65 72 65 20 |dely, bu|gs were |
|00001870| 66 69 78 65 64 20 69 6e | 20 45 78 74 32 66 73 20 |fixed in| Ext2fs |
|00001880| 61 6e 64 20 6c 6f 74 73 | 0a 6f 66 20 69 6d 70 72 |and lots|.of impr|
|00001890| 6f 76 65 6d 65 6e 74 73 | 20 61 6e 64 20 6e 65 77 |ovements| and new|
|000018a0| 20 66 65 61 74 75 72 65 | 73 20 77 65 72 65 20 69 | feature|s were i|
|000018b0| 6e 74 65 67 72 61 74 65 | 64 2e 20 45 78 74 32 66 |ntegrate|d. Ext2f|
|000018c0| 73 20 69 73 20 6e 6f 77 | 20 76 65 72 79 20 73 74 |s is now| very st|
|000018d0| 61 62 6c 65 0a 61 6e 64 | 20 68 61 73 20 62 65 63 |able.and| has bec|
|000018e0| 6f 6d 65 20 74 68 65 20 | 64 65 2d 66 61 63 74 6f |ome the |de-facto|
|000018f0| 20 73 74 61 6e 64 61 72 | 64 20 4c 69 6e 75 78 20 | standar|d Linux |
|00001900| 66 69 6c 65 73 79 73 74 | 65 6d 2e 0a 0a 09 54 68 |filesyst|em....Th|
|00001910| 65 20 74 61 62 6c 65 7e | 5c 72 65 66 20 7b 74 61 |e table~|\ref {ta|
|00001920| 62 6c 65 3a 66 73 7d 20 | 63 6f 6e 74 61 69 6e 73 |ble:fs} |contains|
|00001930| 20 61 20 73 75 6d 6d 61 | 72 79 20 6f 66 20 74 68 | a summa|ry of th|
|00001940| 65 20 66 65 61 74 75 72 | 65 73 0a 70 72 6f 76 69 |e featur|es.provi|
|00001950| 64 65 64 20 62 79 20 74 | 68 65 20 64 69 66 66 65 |ded by t|he diffe|
|00001960| 72 65 6e 74 20 66 69 6c | 65 73 79 73 74 65 6d 73 |rent fil|esystems|
|00001970| 2e 0a 0a 5c 62 65 67 69 | 6e 20 7b 74 61 62 6c 65 |...\begi|n {table|
|00001980| 7d 20 5b 68 74 62 70 5d | 0a 5c 63 61 70 74 69 6f |} [htbp]|.\captio|
|00001990| 6e 20 7b 53 75 6d 6d 61 | 72 79 20 6f 66 20 74 68 |n {Summa|ry of th|
|000019a0| 65 20 66 69 6c 65 73 79 | 73 74 65 6d 20 66 65 61 |e filesy|stem fea|
|000019b0| 74 75 72 65 73 7d 0a 5c | 62 65 67 69 6e 7b 63 65 |tures}.\|begin{ce|
|000019c0| 6e 74 65 72 7d 0a 5c 62 | 65 67 69 6e 20 7b 74 61 |nter}.\b|egin {ta|
|000019d0| 62 75 6c 61 72 7d 20 7b | 7c 6c 7c 63 7c 63 7c 63 |bular} {||l|c|c|c|
|000019e0| 7c 63 7c 7d 20 5c 68 6c | 69 6e 65 0a 09 09 26 20 ||c|} \hl|ine...& |
|000019f0| 4d 69 6e 69 78 20 46 53 | 09 26 20 45 78 74 20 46 |Minix FS|.& Ext F|
|00001a00| 53 09 26 20 45 78 74 32 | 20 46 53 09 26 20 58 69 |S.& Ext2| FS.& Xi|
|00001a10| 61 20 46 53 20 5c 5c 20 | 5c 68 6c 69 6e 65 0a 4d |a FS \\ |\hline.M|
|00001a20| 61 78 20 46 53 20 73 69 | 7a 65 09 26 20 36 34 20 |ax FS si|ze.& 64 |
|00001a30| 4d 42 09 09 26 20 32 20 | 47 42 09 09 26 20 34 20 |MB..& 2 |GB..& 4 |
|00001a40| 54 42 09 09 26 20 32 20 | 47 42 20 5c 5c 0a 4d 61 |TB..& 2 |GB \\.Ma|
|00001a50| 78 20 66 69 6c 65 20 73 | 69 7a 65 09 26 20 36 34 |x file s|ize.& 64|
|00001a60| 20 4d 42 09 09 26 20 32 | 20 47 42 09 09 26 20 32 | MB..& 2| GB..& 2|
|00001a70| 20 47 42 09 09 26 20 36 | 34 20 4d 42 20 5c 5c 0a | GB..& 6|4 MB \\.|
|00001a80| 4d 61 78 20 66 69 6c 65 | 20 6e 61 6d 65 09 26 20 |Max file| name.& |
|00001a90| 31 36 2f 33 30 20 63 09 | 26 20 32 35 35 20 63 09 |16/30 c.|& 255 c.|
|00001aa0| 09 26 20 32 35 35 20 63 | 09 09 26 20 32 34 38 20 |.& 255 c|..& 248 |
|00001ab0| 63 20 5c 5c 0a 33 20 74 | 69 6d 65 73 20 73 75 70 |c \\.3 t|imes sup|
|00001ac0| 70 6f 72 74 09 26 20 4e | 6f 09 09 26 20 4e 6f 09 |port.& N|o..& No.|
|00001ad0| 09 26 20 59 65 73 09 09 | 26 20 59 65 73 20 5c 5c |.& Yes..|& Yes \\|
|00001ae0| 0a 45 78 74 65 6e 73 69 | 62 6c 65 09 26 20 4e 6f |.Extensi|ble.& No|
|00001af0| 09 09 26 20 4e 6f 09 09 | 26 20 59 65 73 09 09 26 |..& No..|& Yes..&|
|00001b00| 20 4e 6f 20 5c 5c 0a 56 | 61 72 2e 20 62 6c 6f 63 | No \\.V|ar. bloc|
|00001b10| 6b 20 73 69 7a 65 09 26 | 20 4e 6f 09 09 26 20 4e |k size.&| No..& N|
|00001b20| 6f 09 09 26 20 59 65 73 | 09 09 26 20 4e 6f 20 5c |o..& Yes|..& No \|
|00001b30| 5c 0a 4d 61 69 6e 74 61 | 69 6e 65 64 09 26 20 59 |\.Mainta|ined.& Y|
|00001b40| 65 73 09 09 26 20 4e 6f | 09 09 26 20 59 65 73 09 |es..& No|..& Yes.|
|00001b50| 09 26 20 3f 20 5c 5c 20 | 5c 68 6c 69 6e 65 0a 5c |.& ? \\ |\hline.\|
|00001b60| 65 6e 64 20 7b 74 61 62 | 75 6c 61 72 7d 0a 5c 65 |end {tab|ular}.\e|
|00001b70| 6e 64 7b 63 65 6e 74 65 | 72 7d 0a 5c 6c 61 62 65 |nd{cente|r}.\labe|
|00001b80| 6c 20 7b 74 61 62 6c 65 | 3a 66 73 7d 0a 5c 65 6e |l {table|:fs}.\en|
|00001b90| 64 20 7b 74 61 62 6c 65 | 7d 0a 0a 5c 73 65 63 74 |d {table|}..\sect|
|00001ba0| 69 6f 6e 20 7b 42 61 73 | 69 63 20 46 69 6c 65 20 |ion {Bas|ic File |
|00001bb0| 53 79 73 74 65 6d 20 43 | 6f 6e 63 65 70 74 73 7d |System C|oncepts}|
|00001bc0| 0a 5c 6c 61 62 65 6c 20 | 7b 73 65 63 74 69 6f 6e |.\label |{section|
|00001bd0| 3a 63 6f 6e 63 65 70 74 | 73 7d 0a 0a 09 45 76 65 |:concept|s}...Eve|
|00001be0| 72 79 20 4c 69 6e 75 78 | 20 66 69 6c 65 73 79 73 |ry Linux| filesys|
|00001bf0| 74 65 6d 20 69 6d 70 6c | 65 6d 65 6e 74 73 20 61 |tem impl|ements a|
|00001c00| 20 62 61 73 69 63 20 73 | 65 74 20 6f 66 20 63 6f | basic s|et of co|
|00001c10| 6d 6d 6f 6e 20 63 6f 6e | 63 65 70 74 73 0a 64 65 |mmon con|cepts.de|
|00001c20| 72 69 76 61 74 65 64 20 | 66 72 6f 6d 20 74 68 65 |rivated |from the|
|00001c30| 20 55 6e 69 78 20 6f 70 | 65 72 61 74 69 6e 67 20 | Unix op|erating |
|00001c40| 73 79 73 74 65 6d 7e 5c | 63 69 74 65 20 7b 62 61 |system~\|cite {ba|
|00001c50| 63 68 7d 3a 20 66 69 6c | 65 73 20 61 72 65 20 72 |ch}: fil|es are r|
|00001c60| 65 70 72 65 73 65 6e 74 | 65 64 0a 62 79 20 69 6e |epresent|ed.by in|
|00001c70| 6f 64 65 73 2c 20 64 69 | 72 65 63 74 6f 72 69 65 |odes, di|rectorie|
|00001c80| 73 20 61 72 65 20 73 69 | 6d 70 6c 79 20 66 69 6c |s are si|mply fil|
|00001c90| 65 73 20 63 6f 6e 74 61 | 69 6e 69 6e 67 20 61 20 |es conta|ining a |
|00001ca0| 6c 69 73 74 20 6f 66 20 | 65 6e 74 72 69 65 73 20 |list of |entries |
|00001cb0| 61 6e 64 0a 64 65 76 69 | 63 65 73 20 63 61 6e 20 |and.devi|ces can |
|00001cc0| 62 65 20 61 63 63 65 73 | 73 65 64 20 62 79 20 72 |be acces|sed by r|
|00001cd0| 65 71 75 65 73 74 69 6e | 67 20 49 2f 4f 20 6f 6e |equestin|g I/O on|
|00001ce0| 20 73 70 65 63 69 61 6c | 20 66 69 6c 65 73 2e 0a | special| files..|
|00001cf0| 0a 5c 73 75 62 73 65 63 | 74 69 6f 6e 20 7b 49 6e |.\subsec|tion {In|
|00001d00| 6f 64 65 73 7d 0a 5c 6c | 61 62 65 6c 20 7b 73 75 |odes}.\l|abel {su|
|00001d10| 62 73 65 63 74 69 6f 6e | 3a 63 6f 6e 63 65 70 74 |bsection|:concept|
|00001d20| 73 3a 69 6e 6f 64 65 73 | 7d 0a 0a 09 45 61 63 68 |s:inodes|}...Each|
|00001d30| 20 66 69 6c 65 20 69 73 | 20 72 65 70 72 65 73 65 | file is| represe|
|00001d40| 6e 74 65 64 20 62 79 20 | 61 20 73 74 72 75 63 74 |nted by |a struct|
|00001d50| 75 72 65 2c 20 63 61 6c | 6c 65 64 20 61 6e 20 69 |ure, cal|led an i|
|00001d60| 6e 6f 64 65 2e 20 45 61 | 63 68 20 69 6e 6f 64 65 |node. Ea|ch inode|
|00001d70| 0a 63 6f 6e 74 61 69 6e | 73 20 74 68 65 20 64 65 |.contain|s the de|
|00001d80| 73 63 72 69 70 74 69 6f | 6e 20 6f 66 20 74 68 65 |scriptio|n of the|
|00001d90| 20 66 69 6c 65 3a 20 66 | 69 6c 65 20 74 79 70 65 | file: f|ile type|
|00001da0| 2c 20 61 63 63 65 73 73 | 20 72 69 67 68 74 73 2c |, access| rights,|
|00001db0| 20 6f 77 6e 65 72 73 2c | 0a 74 69 6d 65 73 74 61 | owners,|.timesta|
|00001dc0| 6d 70 73 2c 0a 73 69 7a | 65 2c 20 70 6f 69 6e 74 |mps,.siz|e, point|
|00001dd0| 65 72 73 20 74 6f 20 64 | 61 74 61 20 62 6c 6f 63 |ers to d|ata bloc|
|00001de0| 6b 73 2e 20 54 68 65 20 | 61 64 64 72 65 73 73 65 |ks. The |addresse|
|00001df0| 73 20 6f 66 20 64 61 74 | 61 20 62 6c 6f 63 6b 73 |s of dat|a blocks|
|00001e00| 20 61 6c 6c 6f 63 61 74 | 65 64 20 74 6f 0a 61 20 | allocat|ed to.a |
|00001e10| 66 69 6c 65 20 61 72 65 | 20 73 74 6f 72 65 64 20 |file are| stored |
|00001e20| 69 6e 20 69 74 73 20 69 | 6e 6f 64 65 2e 20 57 68 |in its i|node. Wh|
|00001e30| 65 6e 20 61 20 75 73 65 | 72 20 72 65 71 75 65 73 |en a use|r reques|
|00001e40| 74 73 20 61 6e 20 49 2f | 4f 20 6f 70 65 72 61 74 |ts an I/|O operat|
|00001e50| 69 6f 6e 20 6f 6e 0a 74 | 68 65 20 66 69 6c 65 2c |ion on.t|he file,|
|00001e60| 20 74 68 65 20 6b 65 72 | 6e 65 6c 20 63 6f 64 65 | the ker|nel code|
|00001e70| 20 63 6f 6e 76 65 72 74 | 73 20 74 68 65 20 63 75 | convert|s the cu|
|00001e80| 72 72 65 6e 74 20 6f 66 | 66 73 65 74 20 74 6f 20 |rrent of|fset to |
|00001e90| 61 20 62 6c 6f 63 6b 20 | 6e 75 6d 62 65 72 2c 0a |a block |number,.|
|00001ea0| 75 73 65 73 20 74 68 69 | 73 20 6e 75 6d 62 65 72 |uses thi|s number|
|00001eb0| 20 61 73 20 61 6e 20 69 | 6e 64 65 78 20 69 6e 20 | as an i|ndex in |
|00001ec0| 74 68 65 20 62 6c 6f 63 | 6b 20 61 64 64 72 65 73 |the bloc|k addres|
|00001ed0| 73 65 73 20 74 61 62 6c | 65 20 61 6e 64 20 72 65 |ses tabl|e and re|
|00001ee0| 61 64 73 20 6f 72 20 77 | 72 69 74 65 73 0a 74 68 |ads or w|rites.th|
|00001ef0| 65 20 70 68 79 73 69 63 | 61 6c 20 62 6c 6f 63 6b |e physic|al block|
|00001f00| 2e 20 46 69 67 75 72 65 | 7e 5c 72 65 66 20 7b 66 |. Figure|~\ref {f|
|00001f10| 69 67 3a 65 78 74 32 66 | 73 2f 69 6e 6f 64 65 7d |ig:ext2f|s/inode}|
|00001f20| 20 72 65 70 72 65 73 65 | 6e 74 73 20 74 68 65 20 | represe|nts the |
|00001f30| 73 74 72 75 63 74 75 72 | 65 20 6f 66 20 61 6e 0a |structur|e of an.|
|00001f40| 69 6e 6f 64 65 2e 0a 0a | 5c 66 69 67 20 7b 65 78 |inode...|\fig {ex|
|00001f50| 74 32 66 73 2f 69 6e 6f | 64 65 7d 20 7b 38 63 6d |t2fs/ino|de} {8cm|
|00001f60| 7d 20 7b 38 63 6d 7d 20 | 7b 53 74 72 75 63 74 75 |} {8cm} |{Structu|
|00001f70| 72 65 20 6f 66 20 61 6e | 20 69 6e 6f 64 65 7d 0a |re of an| inode}.|
|00001f80| 0a 5c 73 75 62 73 65 63 | 74 69 6f 6e 20 7b 44 69 |.\subsec|tion {Di|
|00001f90| 72 65 63 74 6f 72 69 65 | 73 7d 0a 5c 6c 61 62 65 |rectorie|s}.\labe|
|00001fa0| 6c 20 7b 73 75 62 73 65 | 63 74 69 6f 6e 3a 63 6f |l {subse|ction:co|
|00001fb0| 6e 63 65 70 74 73 3a 64 | 69 72 73 7d 0a 0a 09 44 |ncepts:d|irs}...D|
|00001fc0| 69 72 65 63 74 6f 72 69 | 65 73 20 61 72 65 20 73 |irectori|es are s|
|00001fd0| 74 72 75 63 74 75 72 65 | 64 20 69 6e 20 61 20 68 |tructure|d in a h|
|00001fe0| 69 65 72 61 72 63 68 69 | 63 61 6c 20 74 72 65 65 |ierarchi|cal tree|
|00001ff0| 2e 20 45 61 63 68 20 64 | 69 72 65 63 74 6f 72 79 |. Each d|irectory|
|00002000| 0a 63 61 6e 20 63 6f 6e | 74 61 69 6e 20 66 69 6c |.can con|tain fil|
|00002010| 65 73 20 61 6e 64 20 73 | 75 62 64 69 72 65 63 74 |es and s|ubdirect|
|00002020| 6f 72 69 65 73 2e 0a 0a | 09 44 69 72 65 63 74 6f |ories...|.Directo|
|00002030| 72 69 65 73 20 61 72 65 | 20 69 6d 70 6c 65 6d 65 |ries are| impleme|
|00002040| 6e 74 65 64 20 61 73 20 | 61 20 73 70 65 63 69 61 |nted as |a specia|
|00002050| 6c 20 74 79 70 65 20 6f | 66 20 66 69 6c 65 73 2e |l type o|f files.|
|00002060| 20 41 63 74 75 61 6c 6c | 79 2c 0a 61 20 64 69 72 | Actuall|y,.a dir|
|00002070| 65 63 74 6f 72 79 20 69 | 73 20 61 20 66 69 6c 65 |ectory i|s a file|
|00002080| 20 63 6f 6e 74 61 69 6e | 69 6e 67 20 61 20 6c 69 | contain|ing a li|
|00002090| 73 74 20 6f 66 20 65 6e | 74 72 69 65 73 2e 20 45 |st of en|tries. E|
|000020a0| 61 63 68 20 65 6e 74 72 | 79 20 63 6f 6e 74 61 69 |ach entr|y contai|
|000020b0| 6e 73 20 61 6e 0a 69 6e | 6f 64 65 20 6e 75 6d 62 |ns an.in|ode numb|
|000020c0| 65 72 20 61 6e 64 20 61 | 20 66 69 6c 65 20 6e 61 |er and a| file na|
|000020d0| 6d 65 2e 20 57 68 65 6e | 20 61 20 70 72 6f 63 65 |me. When| a proce|
|000020e0| 73 73 20 75 73 65 73 20 | 61 20 70 61 74 68 6e 61 |ss uses |a pathna|
|000020f0| 6d 65 2c 20 74 68 65 20 | 6b 65 72 6e 65 6c 0a 63 |me, the |kernel.c|
|00002100| 6f 64 65 20 73 65 61 72 | 63 68 73 20 69 6e 20 74 |ode sear|chs in t|
|00002110| 68 65 20 64 69 72 65 63 | 74 6f 72 69 65 73 20 74 |he direc|tories t|
|00002120| 6f 20 66 69 6e 64 20 74 | 68 65 20 63 6f 72 72 65 |o find t|he corre|
|00002130| 73 70 6f 6e 64 69 6e 67 | 20 69 6e 6f 64 65 20 6e |sponding| inode n|
|00002140| 75 6d 62 65 72 2e 20 41 | 66 74 65 72 0a 74 68 65 |umber. A|fter.the|
|00002150| 20 6e 61 6d 65 20 68 61 | 73 20 62 65 65 6e 20 63 | name ha|s been c|
|00002160| 6f 6e 76 65 72 74 65 64 | 20 74 6f 20 61 6e 20 69 |onverted| to an i|
|00002170| 6e 6f 64 65 20 6e 75 6d | 62 65 72 2c 20 74 68 65 |node num|ber, the|
|00002180| 20 69 6e 6f 64 65 20 69 | 73 20 6c 6f 61 64 65 64 | inode i|s loaded|
|00002190| 20 69 6e 74 6f 0a 6d 65 | 6d 6f 72 79 20 61 6e 64 | into.me|mory and|
|000021a0| 20 69 73 20 75 73 65 64 | 20 62 79 20 73 75 62 73 | is used| by subs|
|000021b0| 65 71 75 65 6e 74 20 72 | 65 71 75 65 73 74 73 2e |equent r|equests.|
|000021c0| 0a 0a 09 46 69 67 75 72 | 65 7e 5c 72 65 66 20 7b |...Figur|e~\ref {|
|000021d0| 66 69 67 3a 65 78 74 32 | 66 73 2f 64 69 72 7d 20 |fig:ext2|fs/dir} |
|000021e0| 72 65 70 72 65 73 65 6e | 74 73 20 61 20 64 69 72 |represen|ts a dir|
|000021f0| 65 63 74 6f 72 79 2e 0a | 0a 5c 66 69 67 20 7b 65 |ectory..|.\fig {e|
|00002200| 78 74 32 66 73 2f 64 69 | 72 7d 20 7b 37 63 6d 7d |xt2fs/di|r} {7cm}|
|00002210| 20 7b 35 63 6d 7d 20 7b | 53 74 72 75 63 74 75 72 | {5cm} {|Structur|
|00002220| 65 20 6f 66 20 61 20 64 | 69 72 65 63 74 6f 72 79 |e of a d|irectory|
|00002230| 7d 0a 0a 5c 73 75 62 73 | 65 63 74 69 6f 6e 20 7b |}..\subs|ection {|
|00002240| 4c 69 6e 6b 73 7d 0a 5c | 6c 61 62 65 6c 20 7b 73 |Links}.\|label {s|
|00002250| 75 62 73 65 63 74 69 6f | 6e 3a 63 6f 6e 63 65 70 |ubsectio|n:concep|
|00002260| 74 73 3a 6c 69 6e 6b 73 | 7d 0a 0a 09 55 6e 69 78 |ts:links|}...Unix|
|00002270| 20 66 69 6c 65 73 79 73 | 74 65 6d 73 20 69 6d 70 | filesys|tems imp|
|00002280| 6c 65 6d 65 6e 74 20 74 | 68 65 20 63 6f 6e 63 65 |lement t|he conce|
|00002290| 70 74 20 6f 66 20 6c 69 | 6e 6b 2e 20 53 65 76 65 |pt of li|nk. Seve|
|000022a0| 72 61 6c 20 6e 61 6d 65 | 73 20 63 61 6e 0a 62 65 |ral name|s can.be|
|000022b0| 20 61 73 73 6f 63 69 61 | 74 65 64 20 77 69 74 68 | associa|ted with|
|000022c0| 20 61 20 69 6e 6f 64 65 | 2e 20 54 68 65 20 69 6e | a inode|. The in|
|000022d0| 6f 64 65 20 63 6f 6e 74 | 61 69 6e 73 20 61 20 66 |ode cont|ains a f|
|000022e0| 69 65 6c 64 20 63 6f 6e | 74 61 69 6e 69 6e 67 20 |ield con|taining |
|000022f0| 74 68 65 0a 6e 75 6d 62 | 65 72 20 61 73 73 6f 63 |the.numb|er assoc|
|00002300| 69 61 74 65 64 20 77 69 | 74 68 20 74 68 65 20 66 |iated wi|th the f|
|00002310| 69 6c 65 2e 20 41 64 64 | 69 6e 67 20 61 20 6c 69 |ile. Add|ing a li|
|00002320| 6e 6b 20 73 69 6d 70 6c | 79 20 63 6f 6e 73 69 73 |nk simpl|y consis|
|00002330| 74 73 20 69 6e 20 63 72 | 65 61 74 69 6e 67 0a 61 |ts in cr|eating.a|
|00002340| 20 64 69 72 65 63 74 6f | 72 79 20 65 6e 74 72 79 | directo|ry entry|
|00002350| 2c 20 77 68 65 72 65 20 | 74 68 65 20 69 6e 6f 64 |, where |the inod|
|00002360| 65 20 6e 75 6d 62 65 72 | 20 70 6f 69 6e 74 73 20 |e number| points |
|00002370| 74 6f 20 74 68 65 20 69 | 6e 6f 64 65 2c 20 61 6e |to the i|node, an|
|00002380| 64 20 69 6e 0a 69 6e 63 | 72 65 6d 65 6e 74 69 6e |d in.inc|rementin|
|00002390| 67 20 74 68 65 20 6c 69 | 6e 6b 73 20 63 6f 75 6e |g the li|nks coun|
|000023a0| 74 20 69 6e 20 74 68 65 | 20 69 6e 6f 64 65 2e 20 |t in the| inode. |
|000023b0| 57 68 65 6e 20 61 20 6c | 69 6e 6b 20 69 73 20 64 |When a l|ink is d|
|000023c0| 65 6c 65 74 65 64 2c 20 | 69 2e 65 2e 20 77 68 65 |eleted, |i.e. whe|
|000023d0| 6e 0a 6f 6e 65 20 75 73 | 65 73 20 74 68 65 20 7b |n.one us|es the {|
|000023e0| 5c 74 74 20 72 6d 7d 20 | 63 6f 6d 6d 61 6e 64 20 |\tt rm} |command |
|000023f0| 74 6f 20 72 65 6d 6f 76 | 65 20 61 20 66 69 6c 65 |to remov|e a file|
|00002400| 6e 61 6d 65 2c 20 74 68 | 65 20 6b 65 72 6e 65 6c |name, th|e kernel|
|00002410| 20 64 65 63 72 65 6d 65 | 6e 74 73 0a 74 68 65 20 | decreme|nts.the |
|00002420| 6c 69 6e 6b 73 20 63 6f | 75 6e 74 20 61 6e 64 20 |links co|unt and |
|00002430| 64 65 61 6c 6c 6f 63 61 | 74 65 73 20 74 68 65 20 |dealloca|tes the |
|00002440| 69 6e 6f 64 65 20 69 66 | 20 74 68 69 73 20 63 6f |inode if| this co|
|00002450| 75 6e 74 20 62 65 63 6f | 6d 65 73 20 7a 65 72 6f |unt beco|mes zero|
|00002460| 2e 0a 0a 09 54 68 69 73 | 20 74 79 70 65 20 6f 66 |....This| type of|
|00002470| 20 6c 69 6e 6b 20 69 73 | 20 63 61 6c 6c 65 64 20 | link is| called |
|00002480| 61 0a 68 61 72 64 20 6c | 69 6e 6b 20 61 6e 64 20 |a.hard l|ink and |
|00002490| 63 61 6e 20 6f 6e 6c 79 | 20 62 65 20 75 73 65 64 |can only| be used|
|000024a0| 20 77 69 74 68 69 6e 20 | 61 20 73 69 6e 67 6c 65 | within |a single|
|000024b0| 20 66 69 6c 65 73 79 73 | 74 65 6d 3a 20 69 74 20 | filesys|tem: it |
|000024c0| 69 73 20 69 6d 70 6f 73 | 73 69 62 6c 65 0a 74 6f |is impos|sible.to|
|000024d0| 20 63 72 65 61 74 65 20 | 63 72 6f 73 73 2d 66 69 | create |cross-fi|
|000024e0| 6c 65 73 79 73 74 65 6d | 20 68 61 72 64 20 6c 69 |lesystem| hard li|
|000024f0| 6e 6b 73 2e 20 4d 6f 72 | 65 6f 76 65 72 2c 20 68 |nks. Mor|eover, h|
|00002500| 61 72 64 20 6c 69 6e 6b | 73 20 63 61 6e 20 6f 6e |ard link|s can on|
|00002510| 6c 79 20 70 6f 69 6e 74 | 20 6f 6e 0a 66 69 6c 65 |ly point| on.file|
|00002520| 73 3a 20 61 20 64 69 72 | 65 63 74 6f 72 79 20 68 |s: a dir|ectory h|
|00002530| 61 72 64 20 6c 69 6e 6b | 20 63 61 6e 6e 6f 74 20 |ard link| cannot |
|00002540| 62 65 20 63 72 65 61 74 | 65 64 20 74 6f 20 70 72 |be creat|ed to pr|
|00002550| 65 76 65 6e 74 20 74 68 | 65 20 61 70 70 61 72 69 |event th|e appari|
|00002560| 74 69 6f 6e 20 6f 66 0a | 61 20 63 79 63 6c 65 20 |tion of.|a cycle |
|00002570| 69 6e 20 74 68 65 20 64 | 69 72 65 63 74 6f 72 79 |in the d|irectory|
|00002580| 20 74 72 65 65 2e 0a 0a | 09 41 6e 6f 74 68 65 72 | tree...|.Another|
|00002590| 20 6b 69 6e 64 20 6f 66 | 20 6c 69 6e 6b 73 20 65 | kind of| links e|
|000025a0| 78 69 73 74 73 20 69 6e | 20 6d 6f 73 74 20 55 6e |xists in| most Un|
|000025b0| 69 78 20 66 69 6c 65 73 | 79 73 74 65 6d 73 2e 20 |ix files|ystems. |
|000025c0| 53 79 6d 62 6f 6c 69 63 | 20 6c 69 6e 6b 73 0a 61 |Symbolic| links.a|
|000025d0| 72 65 20 73 69 6d 70 6c | 79 20 66 69 6c 65 73 20 |re simpl|y files |
|000025e0| 77 68 69 63 68 20 63 6f | 6e 74 61 69 6e 20 61 20 |which co|ntain a |
|000025f0| 66 69 6c 65 6e 61 6d 65 | 2e 20 57 68 65 6e 20 74 |filename|. When t|
|00002600| 68 65 20 6b 65 72 6e 65 | 6c 20 65 6e 63 6f 75 6e |he kerne|l encoun|
|00002610| 74 65 72 73 20 61 0a 73 | 79 6d 62 6f 6c 69 63 20 |ters a.s|ymbolic |
|00002620| 6c 69 6e 6b 20 64 75 72 | 69 6e 67 20 61 20 70 61 |link dur|ing a pa|
|00002630| 74 68 6e 61 6d 65 20 74 | 6f 20 69 6e 6f 64 65 20 |thname t|o inode |
|00002640| 63 6f 6e 76 65 72 73 69 | 6f 6e 2c 20 69 74 20 72 |conversi|on, it r|
|00002650| 65 70 6c 61 63 65 73 20 | 74 68 65 20 6e 61 6d 65 |eplaces |the name|
|00002660| 0a 6f 66 20 74 68 65 20 | 6c 69 6e 6b 20 62 79 20 |.of the |link by |
|00002670| 69 74 73 20 63 6f 6e 74 | 65 6e 74 73 2c 20 69 2e |its cont|ents, i.|
|00002680| 65 2e 20 74 68 65 20 6e | 61 6d 65 20 6f 66 20 74 |e. the n|ame of t|
|00002690| 68 65 20 74 61 72 67 65 | 74 20 66 69 6c 65 2c 20 |he targe|t file, |
|000026a0| 61 6e 64 20 72 65 73 74 | 61 72 74 73 0a 74 68 65 |and rest|arts.the|
|000026b0| 20 70 61 74 68 6e 61 6d | 65 20 69 6e 74 65 72 70 | pathnam|e interp|
|000026c0| 72 65 74 61 74 69 6f 6e | 2e 20 53 69 6e 63 65 20 |retation|. Since |
|000026d0| 61 20 73 79 6d 62 6f 6c | 69 63 20 6c 69 6e 6b 20 |a symbol|ic link |
|000026e0| 64 6f 65 73 20 6e 6f 74 | 20 70 6f 69 6e 74 20 74 |does not| point t|
|000026f0| 6f 20 61 6e 20 69 6e 6f | 64 65 2c 0a 69 74 20 69 |o an ino|de,.it i|
|00002700| 73 20 70 6f 73 73 69 62 | 6c 65 20 74 6f 20 63 72 |s possib|le to cr|
|00002710| 65 61 74 65 20 63 72 6f | 73 73 2d 66 69 6c 65 73 |eate cro|ss-files|
|00002720| 79 73 74 65 6d 73 20 73 | 79 6d 62 6f 6c 69 63 20 |ystems s|ymbolic |
|00002730| 6c 69 6e 6b 73 2e 20 53 | 79 6d 62 6f 6c 69 63 20 |links. S|ymbolic |
|00002740| 6c 69 6e 6b 73 20 63 61 | 6e 0a 70 6f 69 6e 74 20 |links ca|n.point |
|00002750| 74 6f 20 61 6e 79 20 74 | 79 70 65 20 6f 66 20 66 |to any t|ype of f|
|00002760| 69 6c 65 2c 20 65 76 65 | 6e 20 6f 6e 20 6e 6f 6e |ile, eve|n on non|
|00002770| 65 78 69 73 74 65 6e 74 | 20 66 69 6c 65 73 2e 20 |existent| files. |
|00002780| 53 79 6d 62 6f 6c 69 63 | 20 6c 69 6e 6b 73 20 61 |Symbolic| links a|
|00002790| 72 65 20 76 65 72 79 0a | 75 73 65 66 75 6c 20 62 |re very.|useful b|
|000027a0| 65 63 61 75 73 65 20 74 | 68 65 79 20 64 6f 6e 27 |ecause t|hey don'|
|000027b0| 74 20 68 61 76 65 20 74 | 68 65 20 6c 69 6d 69 74 |t have t|he limit|
|000027c0| 61 74 69 6f 6e 73 20 61 | 73 73 6f 63 69 61 74 65 |ations a|ssociate|
|000027d0| 64 20 74 6f 20 68 61 72 | 64 20 6c 69 6e 6b 73 2e |d to har|d links.|
|000027e0| 0a 48 6f 77 65 76 65 72 | 2c 20 74 68 65 79 20 75 |.However|, they u|
|000027f0| 73 65 20 73 6f 6d 65 20 | 64 69 73 6b 20 73 70 61 |se some |disk spa|
|00002800| 63 65 2c 20 61 6c 6c 6f | 63 61 74 65 64 20 66 6f |ce, allo|cated fo|
|00002810| 72 20 74 68 65 69 72 20 | 69 6e 6f 64 65 20 61 6e |r their |inode an|
|00002820| 64 20 74 68 65 69 72 0a | 64 61 74 61 20 62 6c 6f |d their.|data blo|
|00002830| 63 6b 73 2c 20 61 6e 64 | 20 63 61 75 73 65 0a 61 |cks, and| cause.a|
|00002840| 6e 20 6f 76 65 72 68 65 | 61 64 20 69 6e 20 74 68 |n overhe|ad in th|
|00002850| 65 20 70 61 74 68 6e 61 | 6d 65 20 74 6f 20 69 6e |e pathna|me to in|
|00002860| 6f 64 65 20 63 6f 6e 76 | 65 72 73 69 6f 6e 20 62 |ode conv|ersion b|
|00002870| 65 63 61 75 73 65 20 74 | 68 65 20 6b 65 72 6e 65 |ecause t|he kerne|
|00002880| 6c 20 68 61 73 20 74 6f | 0a 72 65 73 74 61 72 74 |l has to|.restart|
|00002890| 20 74 68 65 20 6e 61 6d | 65 20 69 6e 74 65 72 70 | the nam|e interp|
|000028a0| 72 65 74 61 74 69 6f 6e | 20 77 68 65 6e 20 69 74 |retation| when it|
|000028b0| 20 65 6e 63 6f 75 6e 74 | 65 72 73 20 61 20 73 79 | encount|ers a sy|
|000028c0| 6d 62 6f 6c 69 63 20 6c | 69 6e 6b 2e 0a 0a 5c 73 |mbolic l|ink...\s|
|000028d0| 75 62 73 65 63 74 69 6f | 6e 20 7b 44 65 76 69 63 |ubsectio|n {Devic|
|000028e0| 65 20 73 70 65 63 69 61 | 6c 20 66 69 6c 65 73 7d |e specia|l files}|
|000028f0| 0a 5c 6c 61 62 65 6c 20 | 7b 73 75 62 73 65 63 74 |.\label |{subsect|
|00002900| 69 6f 6e 3a 63 6f 6e 63 | 65 70 74 73 3a 73 70 65 |ion:conc|epts:spe|
|00002910| 63 69 61 6c 7d 0a 0a 09 | 49 6e 20 55 6e 69 78 2d |cial}...|In Unix-|
|00002920| 6c 69 6b 65 20 6f 70 65 | 72 61 74 69 6e 67 20 73 |like ope|rating s|
|00002930| 79 73 74 65 6d 73 2c 20 | 64 65 76 69 63 65 73 20 |ystems, |devices |
|00002940| 63 61 6e 20 62 65 20 61 | 63 63 65 73 73 65 64 20 |can be a|ccessed |
|00002950| 76 69 61 20 73 70 65 63 | 69 61 6c 0a 66 69 6c 65 |via spec|ial.file|
|00002960| 73 2e 20 41 20 64 65 76 | 69 63 65 20 73 70 65 63 |s. A dev|ice spec|
|00002970| 69 61 6c 20 66 69 6c 65 | 20 64 6f 65 73 20 6e 6f |ial file| does no|
|00002980| 74 20 75 73 65 20 61 6e | 79 20 73 70 61 63 65 20 |t use an|y space |
|00002990| 6f 6e 20 74 68 65 20 66 | 69 6c 65 73 79 73 74 65 |on the f|ilesyste|
|000029a0| 6d 2e 20 49 74 20 69 73 | 0a 6f 6e 6c 79 20 61 6e |m. It is|.only an|
|000029b0| 20 61 63 63 65 73 73 20 | 70 6f 69 6e 74 20 74 6f | access |point to|
|000029c0| 20 74 68 65 20 64 65 76 | 69 63 65 20 64 72 69 76 | the dev|ice driv|
|000029d0| 65 72 2e 0a 0a 09 54 77 | 6f 20 74 79 70 65 73 20 |er....Tw|o types |
|000029e0| 6f 66 20 73 70 65 63 69 | 61 6c 20 66 69 6c 65 73 |of speci|al files|
|000029f0| 20 65 78 69 73 74 3a 20 | 63 68 61 72 61 63 74 65 | exist: |characte|
|00002a00| 72 20 61 6e 64 20 62 6c | 6f 63 6b 20 73 70 65 63 |r and bl|ock spec|
|00002a10| 69 61 6c 20 66 69 6c 65 | 73 2e 0a 54 68 65 20 66 |ial file|s..The f|
|00002a20| 6f 72 6d 65 72 20 61 6c | 6c 6f 77 73 20 49 2f 4f |ormer al|lows I/O|
|00002a30| 20 6f 70 65 72 61 74 69 | 6f 6e 73 20 69 6e 20 63 | operati|ons in c|
|00002a40| 68 61 72 61 63 74 65 72 | 20 6d 6f 64 65 20 77 68 |haracter| mode wh|
|00002a50| 69 6c 65 20 74 68 65 20 | 6c 61 74 65 72 20 72 65 |ile the |later re|
|00002a60| 71 75 69 72 65 73 0a 64 | 61 74 61 20 74 6f 20 62 |quires.d|ata to b|
|00002a70| 65 20 77 72 69 74 74 65 | 6e 20 69 6e 20 62 6c 6f |e writte|n in blo|
|00002a80| 63 6b 20 6d 6f 64 65 20 | 76 69 61 20 74 68 65 20 |ck mode |via the |
|00002a90| 62 75 66 66 65 72 20 63 | 61 63 68 65 20 66 75 6e |buffer c|ache fun|
|00002aa0| 63 74 69 6f 6e 73 2e 20 | 57 68 65 6e 20 61 6e 20 |ctions. |When an |
|00002ab0| 49 2f 4f 0a 72 65 71 75 | 65 73 74 20 69 73 20 6d |I/O.requ|est is m|
|00002ac0| 61 64 65 20 6f 6e 20 61 | 20 73 70 65 63 69 61 6c |ade on a| special|
|00002ad0| 20 66 69 6c 65 2c 20 69 | 74 20 69 73 20 66 6f 72 | file, i|t is for|
|00002ae0| 77 61 72 64 65 64 20 74 | 6f 20 61 20 28 70 73 65 |warded t|o a (pse|
|00002af0| 75 64 6f 29 20 64 65 76 | 69 63 65 0a 64 72 69 76 |udo) dev|ice.driv|
|00002b00| 65 72 2e 20 41 20 73 70 | 65 63 69 61 6c 20 66 69 |er. A sp|ecial fi|
|00002b10| 6c 65 20 69 73 20 72 65 | 66 65 72 65 6e 63 65 64 |le is re|ferenced|
|00002b20| 20 62 79 20 61 20 6d 61 | 6a 6f 72 20 6e 75 6d 62 | by a ma|jor numb|
|00002b30| 65 72 2c 20 77 68 69 63 | 68 20 69 64 65 6e 74 69 |er, whic|h identi|
|00002b40| 66 69 65 73 0a 74 68 65 | 20 64 65 76 69 63 65 20 |fies.the| device |
|00002b50| 74 79 70 65 2c 20 61 6e | 64 20 61 20 6d 69 6e 6f |type, an|d a mino|
|00002b60| 72 20 6e 75 6d 62 65 72 | 2c 20 77 68 69 63 68 20 |r number|, which |
|00002b70| 69 64 65 6e 74 69 66 69 | 65 73 20 74 68 65 20 75 |identifi|es the u|
|00002b80| 6e 69 74 2e 0a 0a 5c 73 | 65 63 74 69 6f 6e 20 7b |nit...\s|ection {|
|00002b90| 54 68 65 20 56 69 72 74 | 75 61 6c 20 46 69 6c 65 |The Virt|ual File|
|00002ba0| 20 53 79 73 74 65 6d 7d | 0a 5c 6c 61 62 65 6c 20 | System}|.\label |
|00002bb0| 7b 73 65 63 74 69 6f 6e | 3a 76 66 73 7d 0a 0a 5c |{section|:vfs}..\|
|00002bc0| 73 75 62 73 65 63 74 69 | 6f 6e 20 7b 50 72 69 6e |subsecti|on {Prin|
|00002bd0| 63 69 70 6c 65 7d 0a 5c | 6c 61 62 65 6c 20 7b 73 |ciple}.\|label {s|
|00002be0| 75 62 73 65 63 74 69 6f | 6e 3a 76 66 73 3a 70 72 |ubsectio|n:vfs:pr|
|00002bf0| 69 6e 63 69 70 6c 65 7d | 0a 0a 09 54 68 65 20 4c |inciple}|...The L|
|00002c00| 69 6e 75 78 20 6b 65 72 | 6e 65 6c 20 63 6f 6e 74 |inux ker|nel cont|
|00002c10| 61 69 6e 73 20 61 20 56 | 69 72 74 75 61 6c 20 46 |ains a V|irtual F|
|00002c20| 69 6c 65 20 53 79 73 74 | 65 6d 20 6c 61 79 65 72 |ile Syst|em layer|
|00002c30| 20 77 68 69 63 68 20 69 | 73 20 75 73 65 64 0a 64 | which i|s used.d|
|00002c40| 75 72 69 6e 67 20 73 79 | 73 74 65 6d 20 63 61 6c |uring sy|stem cal|
|00002c50| 6c 73 20 61 63 74 69 6e | 67 20 6f 6e 20 66 69 6c |ls actin|g on fil|
|00002c60| 65 73 2e 20 54 68 65 20 | 56 46 53 20 69 73 20 61 |es. The |VFS is a|
|00002c70| 6e 20 69 6e 64 69 72 65 | 63 74 69 6f 6e 20 6c 61 |n indire|ction la|
|00002c80| 79 65 72 20 77 68 69 63 | 68 0a 68 61 6e 64 6c 65 |yer whic|h.handle|
|00002c90| 73 20 74 68 65 20 66 69 | 6c 65 20 6f 72 69 65 6e |s the fi|le orien|
|00002ca0| 74 65 64 20 73 79 73 74 | 65 6d 20 63 61 6c 6c 73 |ted syst|em calls|
|00002cb0| 20 61 6e 64 20 63 61 6c | 6c 73 20 74 68 65 20 6e | and cal|ls the n|
|00002cc0| 65 63 65 73 73 61 72 79 | 20 66 75 6e 63 74 69 6f |ecessary| functio|
|00002cd0| 6e 73 0a 69 6e 20 74 68 | 65 20 70 68 79 73 69 63 |ns.in th|e physic|
|00002ce0| 61 6c 20 66 69 6c 65 73 | 79 73 74 65 6d 20 63 6f |al files|ystem co|
|00002cf0| 64 65 20 74 6f 20 64 6f | 20 74 68 65 20 49 2f 4f |de to do| the I/O|
|00002d00| 2e 0a 0a 09 54 68 69 73 | 20 69 6e 64 69 72 65 63 |....This| indirec|
|00002d10| 74 69 6f 6e 20 6d 65 63 | 68 61 6e 69 73 6d 20 69 |tion mec|hanism i|
|00002d20| 73 20 66 72 65 71 75 65 | 6e 74 6c 79 20 75 73 65 |s freque|ntly use|
|00002d30| 64 20 69 6e 20 55 6e 69 | 78 2d 6c 69 6b 65 20 6f |d in Uni|x-like o|
|00002d40| 70 65 72 61 74 69 6e 67 | 0a 73 79 73 74 65 6d 73 |perating|.systems|
|00002d50| 20 74 6f 20 65 61 73 65 | 20 74 68 65 20 69 6e 74 | to ease| the int|
|00002d60| 65 67 72 61 74 69 6f 6e | 20 61 6e 64 20 74 68 65 |egration| and the|
|00002d70| 20 75 73 65 20 6f 66 20 | 73 65 76 65 72 61 6c 20 | use of |several |
|00002d80| 66 69 6c 65 73 79 73 74 | 65 6d 20 74 79 70 65 73 |filesyst|em types|
|00002d90| 0a 5c 63 69 74 65 20 7b | 76 6e 6f 64 65 73 2c 6c |.\cite {|vnodes,l|
|00002da0| 66 73 3a 75 6e 69 78 7d | 2e 0a 0a 09 57 68 65 6e |fs:unix}|....When|
|00002db0| 20 61 20 70 72 6f 63 65 | 73 73 20 69 73 73 75 65 | a proce|ss issue|
|00002dc0| 73 20 61 20 66 69 6c 65 | 20 6f 72 69 65 6e 74 65 |s a file| oriente|
|00002dd0| 64 20 73 79 73 74 65 6d | 20 63 61 6c 6c 2c 20 74 |d system| call, t|
|00002de0| 68 65 20 6b 65 72 6e 65 | 6c 20 63 61 6c 6c 73 0a |he kerne|l calls.|
|00002df0| 61 20 66 75 6e 63 74 69 | 6f 6e 20 63 6f 6e 74 61 |a functi|on conta|
|00002e00| 69 6e 65 64 20 69 6e 20 | 74 68 65 20 56 46 53 2e |ined in |the VFS.|
|00002e10| 20 54 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 68 | This fu|nction h|
|00002e20| 61 6e 64 6c 65 73 20 74 | 68 65 20 73 74 72 75 63 |andles t|he struc|
|00002e30| 74 75 72 65 0a 69 6e 64 | 65 70 65 6e 64 65 6e 74 |ture.ind|ependent|
|00002e40| 20 6d 61 6e 69 70 75 6c | 61 74 69 6f 6e 73 20 61 | manipul|ations a|
|00002e50| 6e 64 20 72 65 64 69 72 | 65 63 74 73 20 74 68 65 |nd redir|ects the|
|00002e60| 20 63 61 6c 6c 20 74 6f | 20 61 20 66 75 6e 63 74 | call to| a funct|
|00002e70| 69 6f 6e 20 63 6f 6e 74 | 61 69 6e 65 64 0a 69 6e |ion cont|ained.in|
|00002e80| 20 74 68 65 20 70 68 79 | 73 69 63 61 6c 0a 66 69 | the phy|sical.fi|
|00002e90| 6c 65 73 79 73 74 65 6d | 20 63 6f 64 65 2c 20 77 |lesystem| code, w|
|00002ea0| 68 69 63 68 20 69 73 20 | 72 65 73 70 6f 6e 73 69 |hich is |responsi|
|00002eb0| 62 6c 65 20 66 6f 72 20 | 68 61 6e 64 6c 69 6e 67 |ble for |handling|
|00002ec0| 20 74 68 65 20 73 74 72 | 75 63 74 75 72 65 20 64 | the str|ucture d|
|00002ed0| 65 70 65 6e 64 65 6e 74 | 0a 6f 70 65 72 61 74 69 |ependent|.operati|
|00002ee0| 6f 6e 73 2e 20 46 69 6c | 65 73 79 73 74 65 6d 20 |ons. Fil|esystem |
|00002ef0| 63 6f 64 65 20 75 73 65 | 73 20 74 68 65 20 62 75 |code use|s the bu|
|00002f00| 66 66 65 72 20 63 61 63 | 68 65 20 66 75 6e 63 74 |ffer cac|he funct|
|00002f10| 69 6f 6e 73 20 74 6f 20 | 72 65 71 75 65 73 74 0a |ions to |request.|
|00002f20| 49 2f 4f 20 6f 6e 20 64 | 65 76 69 63 65 73 2e 20 |I/O on d|evices. |
|00002f30| 54 68 69 73 20 73 63 68 | 65 6d 65 20 69 73 20 69 |This sch|eme is i|
|00002f40| 6c 6c 75 73 74 72 61 74 | 65 64 20 6f 6e 20 66 69 |llustrat|ed on fi|
|00002f50| 67 75 72 65 7e 5c 72 65 | 66 20 7b 66 69 67 3a 65 |gure~\re|f {fig:e|
|00002f60| 78 74 32 66 73 2f 76 66 | 73 7d 2e 0a 0a 5c 66 69 |xt2fs/vf|s}...\fi|
|00002f70| 67 20 7b 65 78 74 32 66 | 73 2f 76 66 73 7d 20 7b |g {ext2f|s/vfs} {|
|00002f80| 37 63 6d 7d 20 7b 39 63 | 6d 7d 20 7b 54 68 65 20 |7cm} {9c|m} {The |
|00002f90| 56 46 53 20 4c 61 79 65 | 72 7d 0a 0a 5c 73 75 62 |VFS Laye|r}..\sub|
|00002fa0| 73 65 63 74 69 6f 6e 20 | 7b 54 68 65 20 56 46 53 |section |{The VFS|
|00002fb0| 20 73 74 72 75 63 74 75 | 72 65 7d 0a 5c 6c 61 62 | structu|re}.\lab|
|00002fc0| 65 6c 20 7b 73 75 62 73 | 65 63 74 69 6f 6e 3a 76 |el {subs|ection:v|
|00002fd0| 66 73 3a 73 74 72 75 63 | 74 75 72 65 7d 0a 0a 09 |fs:struc|ture}...|
|00002fe0| 54 68 65 20 56 46 53 20 | 64 65 66 69 6e 65 73 20 |The VFS |defines |
|00002ff0| 61 20 73 65 74 20 6f 66 | 20 66 75 6e 63 74 69 6f |a set of| functio|
|00003000| 6e 73 20 74 68 61 74 20 | 65 76 65 72 79 20 66 69 |ns that |every fi|
|00003010| 6c 65 73 79 73 74 65 6d | 20 68 61 73 20 74 6f 0a |lesystem| has to.|
|00003020| 69 6d 70 6c 65 6d 65 6e | 74 2e 20 54 68 69 73 20 |implemen|t. This |
|00003030| 69 6e 74 65 72 66 61 63 | 65 20 69 73 20 6d 61 64 |interfac|e is mad|
|00003040| 65 20 75 70 20 6f 66 20 | 61 20 73 65 74 20 6f 66 |e up of |a set of|
|00003050| 20 6f 70 65 72 61 74 69 | 6f 6e 73 20 61 73 73 6f | operati|ons asso|
|00003060| 63 69 61 74 65 64 20 74 | 6f 0a 74 68 72 65 65 20 |ciated t|o.three |
|00003070| 6b 69 6e 64 73 20 6f 66 | 20 6f 62 6a 65 63 74 73 |kinds of| objects|
|00003080| 3a 20 66 69 6c 65 73 79 | 73 74 65 6d 73 2c 20 69 |: filesy|stems, i|
|00003090| 6e 6f 64 65 73 2c 20 61 | 6e 64 20 6f 70 65 6e 20 |nodes, a|nd open |
|000030a0| 66 69 6c 65 73 2e 0a 0a | 09 54 68 65 20 56 46 53 |files...|.The VFS|
|000030b0| 20 6b 6e 6f 77 73 20 61 | 62 6f 75 74 20 66 69 6c | knows a|bout fil|
|000030c0| 65 73 79 73 74 65 6d 20 | 74 79 70 65 73 20 73 75 |esystem |types su|
|000030d0| 70 70 6f 72 74 65 64 20 | 69 6e 20 74 68 65 20 6b |pported |in the k|
|000030e0| 65 72 6e 65 6c 2e 20 49 | 74 0a 75 73 65 73 20 61 |ernel. I|t.uses a|
|000030f0| 20 74 61 62 6c 65 20 64 | 65 66 69 6e 65 64 20 64 | table d|efined d|
|00003100| 75 72 69 6e 67 20 74 68 | 65 20 6b 65 72 6e 65 6c |uring th|e kernel|
|00003110| 20 63 6f 6e 66 69 67 75 | 72 61 74 69 6f 6e 2e 20 | configu|ration. |
|00003120| 45 61 63 68 20 65 6e 74 | 72 79 20 69 6e 20 74 68 |Each ent|ry in th|
|00003130| 69 73 20 74 61 62 6c 65 | 0a 64 65 73 63 72 69 62 |is table|.describ|
|00003140| 65 73 20 61 20 66 69 6c | 65 73 79 73 74 65 6d 20 |es a fil|esystem |
|00003150| 74 79 70 65 3a 20 69 74 | 20 63 6f 6e 74 61 69 6e |type: it| contain|
|00003160| 73 20 74 68 65 20 6e 61 | 6d 65 20 6f 66 20 74 68 |s the na|me of th|
|00003170| 65 20 66 69 6c 65 73 79 | 73 74 65 6d 20 74 79 70 |e filesy|stem typ|
|00003180| 65 20 61 6e 64 0a 61 20 | 70 6f 69 6e 74 65 72 20 |e and.a |pointer |
|00003190| 6f 6e 20 61 20 66 75 6e | 63 74 69 6f 6e 20 63 61 |on a fun|ction ca|
|000031a0| 6c 6c 65 64 20 64 75 72 | 69 6e 67 20 74 68 65 20 |lled dur|ing the |
|000031b0| 6d 6f 75 6e 74 20 6f 70 | 65 72 61 74 69 6f 6e 2e |mount op|eration.|
|000031c0| 20 57 68 65 6e 20 61 20 | 66 69 6c 65 73 79 73 74 | When a |filesyst|
|000031d0| 65 6d 0a 69 73 20 74 6f | 20 62 65 20 6d 6f 75 6e |em.is to| be moun|
|000031e0| 74 65 64 2c 20 74 68 65 | 20 61 70 70 72 6f 70 72 |ted, the| appropr|
|000031f0| 69 61 74 65 20 6d 6f 75 | 6e 74 20 66 75 6e 63 74 |iate mou|nt funct|
|00003200| 69 6f 6e 20 69 73 20 63 | 61 6c 6c 65 64 2e 20 54 |ion is c|alled. T|
|00003210| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 0a 69 73 20 |his func|tion.is |
|00003220| 72 65 73 70 6f 6e 73 69 | 62 6c 65 20 66 6f 72 20 |responsi|ble for |
|00003230| 72 65 61 64 69 6e 67 20 | 74 68 65 20 73 75 70 65 |reading |the supe|
|00003240| 72 62 6c 6f 63 6b 20 66 | 72 6f 6d 20 74 68 65 20 |rblock f|rom the |
|00003250| 64 69 73 6b 2c 20 69 6e | 69 74 69 61 6c 69 7a 69 |disk, in|itializi|
|00003260| 6e 67 20 69 74 73 0a 69 | 6e 74 65 72 6e 61 6c 20 |ng its.i|nternal |
|00003270| 76 61 72 69 61 62 6c 65 | 73 2c 20 61 6e 64 20 72 |variable|s, and r|
|00003280| 65 74 75 72 6e 69 6e 67 | 20 61 20 6d 6f 75 6e 74 |eturning| a mount|
|00003290| 65 64 20 66 69 6c 65 73 | 79 73 74 65 6d 20 64 65 |ed files|ystem de|
|000032a0| 73 63 72 69 70 74 6f 72 | 20 74 6f 20 74 68 65 20 |scriptor| to the |
|000032b0| 56 46 53 2e 0a 41 66 74 | 65 72 0a 74 68 65 20 66 |VFS..Aft|er.the f|
|000032c0| 69 6c 65 73 79 73 74 65 | 6d 20 69 73 20 6d 6f 75 |ilesyste|m is mou|
|000032d0| 6e 74 65 64 2c 20 74 68 | 65 20 56 46 53 20 66 75 |nted, th|e VFS fu|
|000032e0| 6e 63 74 69 6f 6e 73 20 | 63 61 6e 20 75 73 65 20 |nctions |can use |
|000032f0| 74 68 69 73 20 64 65 73 | 63 72 69 70 74 6f 72 20 |this des|criptor |
|00003300| 74 6f 0a 61 63 63 65 73 | 73 20 74 68 65 20 70 68 |to.acces|s the ph|
|00003310| 79 73 69 63 61 6c 20 66 | 69 6c 65 73 79 73 74 65 |ysical f|ilesyste|
|00003320| 6d 20 72 6f 75 74 69 6e | 65 73 2e 0a 0a 09 41 20 |m routin|es....A |
|00003330| 6d 6f 75 6e 74 65 64 20 | 66 69 6c 65 73 79 73 74 |mounted |filesyst|
|00003340| 65 6d 20 64 65 73 63 72 | 69 70 74 6f 72 20 63 6f |em descr|iptor co|
|00003350| 6e 74 61 69 6e 73 20 73 | 65 76 65 72 61 6c 20 6b |ntains s|everal k|
|00003360| 69 6e 64 73 20 6f 66 20 | 64 61 74 61 3a 0a 69 6e |inds of |data:.in|
|00003370| 66 6f 72 6d 61 74 69 6f | 6e 73 20 74 68 61 74 20 |formatio|ns that |
|00003380| 61 72 65 20 63 6f 6d 6d | 6f 6e 20 74 6f 20 65 76 |are comm|on to ev|
|00003390| 65 72 79 20 66 69 6c 65 | 73 79 73 74 65 6d 20 74 |ery file|system t|
|000033a0| 79 70 65 73 2c 20 70 6f | 69 6e 74 65 72 73 20 74 |ypes, po|inters t|
|000033b0| 6f 20 66 75 6e 63 74 69 | 6f 6e 73 0a 70 72 6f 76 |o functi|ons.prov|
|000033c0| 69 64 65 64 20 62 79 20 | 74 68 65 20 70 68 79 73 |ided by |the phys|
|000033d0| 69 63 61 6c 20 66 69 6c | 65 73 79 73 74 65 6d 20 |ical fil|esystem |
|000033e0| 6b 65 72 6e 65 6c 20 63 | 6f 64 65 2c 20 61 6e 64 |kernel c|ode, and|
|000033f0| 20 70 72 69 76 61 74 65 | 20 64 61 74 61 20 6d 61 | private| data ma|
|00003400| 69 6e 74 61 69 6e 65 64 | 0a 62 79 20 74 68 65 20 |intained|.by the |
|00003410| 70 68 79 73 69 63 61 6c | 20 66 69 6c 65 73 79 73 |physical| filesys|
|00003420| 74 65 6d 20 63 6f 64 65 | 2e 20 54 68 65 20 66 75 |tem code|. The fu|
|00003430| 6e 63 74 69 6f 6e 20 70 | 6f 69 6e 74 65 72 73 20 |nction p|ointers |
|00003440| 63 6f 6e 74 61 69 6e 65 | 64 20 69 6e 20 74 68 65 |containe|d in the|
|00003450| 0a 66 69 6c 65 73 79 73 | 74 65 6d 20 64 65 73 63 |.filesys|tem desc|
|00003460| 72 69 70 74 6f 72 73 20 | 61 6c 6c 6f 77 20 74 68 |riptors |allow th|
|00003470| 65 20 56 46 53 20 74 6f | 20 61 63 63 65 73 73 20 |e VFS to| access |
|00003480| 74 68 65 20 66 69 6c 65 | 73 79 73 74 65 6d 20 69 |the file|system i|
|00003490| 6e 74 65 72 6e 61 6c 0a | 72 6f 75 74 69 6e 65 73 |nternal.|routines|
|000034a0| 2e 0a 0a 09 54 77 6f 20 | 6f 74 68 65 72 20 74 79 |....Two |other ty|
|000034b0| 70 65 73 20 6f 66 20 64 | 65 73 63 72 69 70 74 6f |pes of d|escripto|
|000034c0| 72 73 20 61 72 65 20 75 | 73 65 64 20 62 79 20 74 |rs are u|sed by t|
|000034d0| 68 65 20 56 46 53 3a 20 | 61 6e 20 69 6e 6f 64 65 |he VFS: |an inode|
|000034e0| 20 64 65 73 63 72 69 70 | 74 6f 72 0a 61 6e 64 20 | descrip|tor.and |
|000034f0| 61 6e 20 6f 70 65 6e 20 | 66 69 6c 65 20 64 65 73 |an open |file des|
|00003500| 63 72 69 70 74 6f 72 2e | 20 45 61 63 68 20 64 65 |criptor.| Each de|
|00003510| 73 63 72 69 70 74 6f 72 | 20 63 6f 6e 74 61 69 6e |scriptor| contain|
|00003520| 73 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 73 20 72 |s inform|ations r|
|00003530| 65 6c 61 74 65 64 20 74 | 6f 0a 66 69 6c 65 73 20 |elated t|o.files |
|00003540| 69 6e 20 75 73 65 20 61 | 6e 64 20 61 20 73 65 74 |in use a|nd a set|
|00003550| 20 6f 66 20 6f 70 65 72 | 61 74 69 6f 6e 73 20 70 | of oper|ations p|
|00003560| 72 6f 76 69 64 65 64 20 | 62 79 20 74 68 65 20 70 |rovided |by the p|
|00003570| 68 79 73 69 63 61 6c 20 | 66 69 6c 65 73 79 73 74 |hysical |filesyst|
|00003580| 65 6d 20 63 6f 64 65 2e | 0a 57 68 69 6c 65 20 74 |em code.|.While t|
|00003590| 68 65 20 69 6e 6f 64 65 | 20 64 65 73 63 72 69 70 |he inode| descrip|
|000035a0| 74 6f 72 20 63 6f 6e 74 | 61 69 6e 73 20 70 6f 69 |tor cont|ains poi|
|000035b0| 6e 74 65 72 73 20 74 6f | 20 66 75 6e 63 74 69 6f |nters to| functio|
|000035c0| 6e 73 20 74 68 61 74 20 | 63 61 6e 20 62 65 20 75 |ns that |can be u|
|000035d0| 73 65 64 20 74 6f 0a 61 | 63 74 20 6f 6e 20 61 6e |sed to.a|ct on an|
|000035e0| 79 20 66 69 6c 65 20 28 | 65 2e 67 2e 20 7b 5c 74 |y file (|e.g. {\t|
|000035f0| 74 20 63 72 65 61 74 65 | 7d 2c 20 7b 5c 74 74 20 |t create|}, {\tt |
|00003600| 75 6e 6c 69 6e 6b 7d 29 | 2c 20 74 68 65 20 66 69 |unlink})|, the fi|
|00003610| 6c 65 20 64 65 73 63 72 | 69 70 74 6f 72 73 0a 63 |le descr|iptors.c|
|00003620| 6f 6e 74 61 69 6e 73 20 | 70 6f 69 6e 74 65 72 20 |ontains |pointer |
|00003630| 74 6f 20 66 75 6e 63 74 | 69 6f 6e 73 20 77 68 69 |to funct|ions whi|
|00003640| 63 68 20 63 61 6e 20 6f | 6e 6c 79 20 61 63 74 20 |ch can o|nly act |
|00003650| 6f 6e 20 6f 70 65 6e 20 | 66 69 6c 65 73 20 28 65 |on open |files (e|
|00003660| 2e 67 2e 0a 7b 5c 74 74 | 20 72 65 61 64 7d 2c 20 |.g..{\tt| read}, |
|00003670| 7b 5c 74 74 20 77 72 69 | 74 65 7d 29 2e 0a 0a 5c |{\tt wri|te})...\|
|00003680| 73 65 63 74 69 6f 6e 20 | 7b 54 68 65 20 53 65 63 |section |{The Sec|
|00003690| 6f 6e 64 20 45 78 74 65 | 6e 64 65 64 20 46 69 6c |ond Exte|nded Fil|
|000036a0| 65 20 53 79 73 74 65 6d | 7d 0a 5c 6c 61 62 65 6c |e System|}.\label|
|000036b0| 20 7b 73 65 63 74 69 6f | 6e 3a 65 78 74 32 66 73 | {sectio|n:ext2fs|
|000036c0| 7d 0a 0a 5c 73 75 62 73 | 65 63 74 69 6f 6e 20 7b |}..\subs|ection {|
|000036d0| 4d 6f 74 69 76 61 74 69 | 6f 6e 73 7d 0a 5c 6c 61 |Motivati|ons}.\la|
|000036e0| 62 65 6c 20 7b 73 75 62 | 73 65 63 74 69 6f 6e 3a |bel {sub|section:|
|000036f0| 65 78 74 32 66 73 3a 6d | 6f 74 69 76 61 74 69 6f |ext2fs:m|otivatio|
|00003700| 6e 73 7d 0a 0a 54 68 65 | 20 53 65 63 6f 6e 64 20 |ns}..The| Second |
|00003710| 45 78 74 65 6e 64 65 64 | 20 46 69 6c 65 20 53 79 |Extended| File Sy|
|00003720| 73 74 65 6d 20 68 61 73 | 20 62 65 65 6e 20 64 65 |stem has| been de|
|00003730| 73 69 67 6e 65 64 20 61 | 6e 64 20 69 6d 70 6c 65 |signed a|nd imple|
|00003740| 6d 65 6e 74 65 64 20 74 | 6f 0a 66 69 78 20 73 6f |mented t|o.fix so|
|00003750| 6d 65 20 70 72 6f 62 6c | 65 6d 73 20 70 72 65 73 |me probl|ems pres|
|00003760| 65 6e 74 20 69 6e 20 74 | 68 65 20 66 69 72 73 74 |ent in t|he first|
|00003770| 20 45 78 74 65 6e 64 65 | 64 20 46 69 6c 65 20 53 | Extende|d File S|
|00003780| 79 73 74 65 6d 2e 20 4f | 75 72 20 67 6f 61 6c 0a |ystem. O|ur goal.|
|00003790| 77 61 73 20 74 6f 20 70 | 72 6f 76 69 64 65 20 61 |was to p|rovide a|
|000037a0| 20 70 6f 77 65 72 66 75 | 6c 20 66 69 6c 65 73 79 | powerfu|l filesy|
|000037b0| 73 74 65 6d 2c 20 77 68 | 69 63 68 20 69 6d 70 6c |stem, wh|ich impl|
|000037c0| 65 6d 65 6e 74 73 20 55 | 6e 69 78 20 66 69 6c 65 |ements U|nix file|
|000037d0| 20 73 65 6d 61 6e 74 69 | 63 73 0a 61 6e 64 20 6f | semanti|cs.and o|
|000037e0| 66 66 65 72 73 20 61 64 | 76 61 6e 63 65 64 20 66 |ffers ad|vanced f|
|000037f0| 65 61 74 75 72 65 73 2e | 0a 0a 09 4f 66 20 63 6f |eatures.|...Of co|
|00003800| 75 72 73 65 2c 20 77 65 | 20 77 61 6e 74 65 64 20 |urse, we| wanted |
|00003810| 74 6f 20 45 78 74 32 66 | 73 20 74 6f 20 68 61 76 |to Ext2f|s to hav|
|00003820| 65 20 65 78 63 65 6c 6c | 65 6e 74 0a 70 65 72 66 |e excell|ent.perf|
|00003830| 6f 72 6d 61 6e 63 65 2e | 20 20 57 65 20 61 6c 73 |ormance.| We als|
|00003840| 6f 20 77 61 6e 74 65 64 | 20 74 6f 20 70 72 6f 76 |o wanted| to prov|
|00003850| 69 64 65 20 61 20 76 65 | 72 79 20 72 6f 62 75 73 |ide a ve|ry robus|
|00003860| 74 20 66 69 6c 65 73 79 | 73 74 65 6d 0a 69 6e 20 |t filesy|stem.in |
|00003870| 6f 72 64 65 72 20 74 6f | 20 72 65 64 75 63 65 20 |order to| reduce |
|00003880| 74 68 65 20 72 69 73 6b | 20 6f 66 20 64 61 74 61 |the risk| of data|
|00003890| 20 6c 6f 73 73 20 69 6e | 0a 69 6e 74 65 6e 73 69 | loss in|.intensi|
|000038a0| 76 65 20 75 73 65 2e 20 | 4c 61 73 74 2c 20 62 75 |ve use. |Last, bu|
|000038b0| 74 20 6e 6f 74 20 6c 65 | 61 73 74 2c 20 45 78 74 |t not le|ast, Ext|
|000038c0| 32 66 73 20 68 61 64 20 | 74 6f 20 69 6e 63 6c 75 |2fs had |to inclu|
|000038d0| 64 65 20 70 72 6f 76 69 | 73 69 6f 6e 20 66 6f 72 |de provi|sion for|
|000038e0| 0a 65 78 74 65 6e 73 69 | 6f 6e 73 20 74 6f 20 61 |.extensi|ons to a|
|000038f0| 6c 6c 6f 77 20 75 73 65 | 72 73 20 74 6f 20 62 65 |llow use|rs to be|
|00003900| 6e 65 66 69 74 20 66 72 | 6f 6d 20 6e 65 77 20 66 |nefit fr|om new f|
|00003910| 65 61 74 75 72 65 73 20 | 77 69 74 68 6f 75 74 20 |eatures |without |
|00003920| 72 65 66 6f 72 6d 61 74 | 74 69 6e 67 0a 74 68 65 |reformat|ting.the|
|00003930| 69 72 20 66 69 6c 65 73 | 79 73 74 65 6d 2e 0a 0a |ir files|ystem...|
|00003940| 5c 73 75 62 73 65 63 74 | 69 6f 6e 20 7b 60 60 53 |\subsect|ion {``S|
|00003950| 74 61 6e 64 61 72 64 27 | 27 20 45 78 74 32 66 73 |tandard'|' Ext2fs|
|00003960| 20 66 65 61 74 75 72 65 | 73 7d 0a 5c 6c 61 62 65 | feature|s}.\labe|
|00003970| 6c 20 7b 73 75 62 73 65 | 63 74 69 6f 6e 3a 65 78 |l {subse|ction:ex|
|00003980| 74 32 66 73 3a 73 74 64 | 2d 66 65 61 74 7d 0a 0a |t2fs:std|-feat}..|
|00003990| 54 68 65 20 45 78 74 32 | 66 73 20 73 75 70 70 6f |The Ext2|fs suppo|
|000039a0| 72 74 73 20 73 74 61 6e | 64 61 72 64 20 55 6e 69 |rts stan|dard Uni|
|000039b0| 78 20 66 69 6c 65 20 74 | 79 70 65 73 3a 20 72 65 |x file t|ypes: re|
|000039c0| 67 75 6c 61 72 20 66 69 | 6c 65 73 2c 20 64 69 72 |gular fi|les, dir|
|000039d0| 65 63 74 6f 72 69 65 73 | 2c 0a 64 65 76 69 63 65 |ectories|,.device|
|000039e0| 20 73 70 65 63 69 61 6c | 20 66 69 6c 65 73 20 61 | special| files a|
|000039f0| 6e 64 20 73 79 6d 62 6f | 6c 69 63 20 6c 69 6e 6b |nd symbo|lic link|
|00003a00| 73 2e 0a 0a 45 78 74 32 | 66 73 20 69 73 20 61 62 |s...Ext2|fs is ab|
|00003a10| 6c 65 20 74 6f 20 6d 61 | 6e 61 67 65 20 66 69 6c |le to ma|nage fil|
|00003a20| 65 73 79 73 74 65 6d 73 | 20 63 72 65 61 74 65 64 |esystems| created|
|00003a30| 20 6f 6e 20 72 65 61 6c | 6c 79 20 62 69 67 0a 70 | on real|ly big.p|
|00003a40| 61 72 74 69 74 69 6f 6e | 73 2e 20 57 68 69 6c 65 |artition|s. While|
|00003a50| 20 74 68 65 20 6f 72 69 | 67 69 6e 61 6c 20 6b 65 | the ori|ginal ke|
|00003a60| 72 6e 65 6c 20 63 6f 64 | 65 20 72 65 73 74 72 69 |rnel cod|e restri|
|00003a70| 63 74 65 64 20 74 68 65 | 20 6d 61 78 69 6d 61 6c |cted the| maximal|
|00003a80| 0a 66 69 6c 65 73 79 73 | 74 65 6d 20 73 69 7a 65 |.filesys|tem size|
|00003a90| 20 74 6f 20 32 20 47 42 | 2c 0a 72 65 63 65 6e 74 | to 2 GB|,.recent|
|00003aa0| 20 77 6f 72 6b 20 69 6e | 20 74 68 65 20 56 46 53 | work in| the VFS|
|00003ab0| 20 6c 61 79 65 72 20 68 | 61 76 65 20 72 61 69 73 | layer h|ave rais|
|00003ac0| 65 64 20 74 68 69 73 20 | 6c 69 6d 69 74 20 74 6f |ed this |limit to|
|00003ad0| 20 34 20 54 42 2e 20 54 | 68 75 73 2c 20 69 74 20 | 4 TB. T|hus, it |
|00003ae0| 69 73 20 6e 6f 77 0a 70 | 6f 73 73 69 62 6c 65 20 |is now.p|ossible |
|00003af0| 74 6f 20 75 73 65 20 62 | 69 67 20 64 69 73 6b 73 |to use b|ig disks|
|00003b00| 20 77 69 74 68 6f 75 74 | 20 74 68 65 20 6e 65 65 | without| the nee|
|00003b10| 64 20 6f 66 20 63 72 65 | 61 74 69 6e 67 20 6d 61 |d of cre|ating ma|
|00003b20| 6e 79 20 70 61 72 74 69 | 74 69 6f 6e 73 2e 0a 0a |ny parti|tions...|
|00003b30| 45 78 74 32 66 73 20 70 | 72 6f 76 69 64 65 73 20 |Ext2fs p|rovides |
|00003b40| 6c 6f 6e 67 20 66 69 6c | 65 20 6e 61 6d 65 73 2e |long fil|e names.|
|00003b50| 20 49 74 20 75 73 65 73 | 20 76 61 72 69 61 62 6c | It uses| variabl|
|00003b60| 65 20 6c 65 6e 67 74 68 | 20 64 69 72 65 63 74 6f |e length| directo|
|00003b70| 72 79 20 65 6e 74 72 69 | 65 73 2e 0a 54 68 65 20 |ry entri|es..The |
|00003b80| 6d 61 78 69 6d 61 6c 20 | 66 69 6c 65 20 6e 61 6d |maximal |file nam|
|00003b90| 65 20 73 69 7a 65 20 69 | 73 20 32 35 35 20 63 68 |e size i|s 255 ch|
|00003ba0| 61 72 61 63 74 65 72 73 | 2e 20 54 68 69 73 20 6c |aracters|. This l|
|00003bb0| 69 6d 69 74 20 63 6f 75 | 6c 64 20 62 65 20 65 78 |imit cou|ld be ex|
|00003bc0| 74 65 6e 64 65 64 0a 74 | 6f 20 31 30 31 32 20 69 |tended.t|o 1012 i|
|00003bd0| 66 20 6e 65 65 64 65 64 | 2e 0a 0a 45 78 74 32 66 |f needed|...Ext2f|
|00003be0| 73 20 72 65 73 65 72 76 | 65 73 20 73 6f 6d 65 20 |s reserv|es some |
|00003bf0| 62 6c 6f 63 6b 73 20 66 | 6f 72 20 74 68 65 20 73 |blocks f|or the s|
|00003c00| 75 70 65 72 20 75 73 65 | 72 20 28 7b 5c 74 74 20 |uper use|r ({\tt |
|00003c10| 72 6f 6f 74 7d 29 2e 20 | 4e 6f 72 6d 61 6c 6c 79 |root}). |Normally|
|00003c20| 2c 20 35 5c 25 0a 6f 66 | 20 74 68 65 20 62 6c 6f |, 5\%.of| the blo|
|00003c30| 63 6b 73 20 61 72 65 20 | 72 65 73 65 72 76 65 64 |cks are |reserved|
|00003c40| 2e 20 54 68 69 73 20 61 | 6c 6c 6f 77 73 20 74 68 |. This a|llows th|
|00003c50| 65 20 61 64 6d 69 6e 69 | 73 74 72 61 74 6f 72 20 |e admini|strator |
|00003c60| 74 6f 20 72 65 63 6f 76 | 65 72 20 65 61 73 69 6c |to recov|er easil|
|00003c70| 79 0a 66 72 6f 6d 20 73 | 69 74 75 61 74 69 6f 6e |y.from s|ituation|
|00003c80| 73 20 77 68 65 72 65 20 | 75 73 65 72 20 70 72 6f |s where |user pro|
|00003c90| 63 65 73 73 65 73 20 66 | 69 6c 6c 20 75 70 20 66 |cesses f|ill up f|
|00003ca0| 69 6c 65 73 79 73 74 65 | 6d 73 2e 0a 0a 5c 73 75 |ilesyste|ms...\su|
|00003cb0| 62 73 65 63 74 69 6f 6e | 20 7b 60 60 41 64 76 61 |bsection| {``Adva|
|00003cc0| 6e 63 65 64 27 27 20 45 | 78 74 32 66 73 20 66 65 |nced'' E|xt2fs fe|
|00003cd0| 61 74 75 72 65 73 7d 0a | 5c 6c 61 62 65 6c 20 7b |atures}.|\label {|
|00003ce0| 73 75 62 73 65 63 74 69 | 6f 6e 3a 65 78 74 32 66 |subsecti|on:ext2f|
|00003cf0| 73 3a 61 64 76 2d 66 65 | 61 74 7d 0a 0a 49 6e 20 |s:adv-fe|at}..In |
|00003d00| 61 64 64 69 74 69 6f 6e | 20 74 6f 20 74 68 65 20 |addition| to the |
|00003d10| 73 74 61 6e 64 61 72 64 | 20 55 6e 69 78 20 66 65 |standard| Unix fe|
|00003d20| 61 74 75 72 65 73 2c 20 | 45 78 74 32 66 73 20 73 |atures, |Ext2fs s|
|00003d30| 75 70 70 6f 72 74 73 20 | 73 6f 6d 65 20 65 78 74 |upports |some ext|
|00003d40| 65 6e 73 69 6f 6e 73 0a | 77 68 69 63 68 20 61 72 |ensions.|which ar|
|00003d50| 65 20 6e 6f 74 20 75 73 | 75 61 6c 6c 79 20 70 72 |e not us|ually pr|
|00003d60| 65 73 65 6e 74 20 69 6e | 20 55 6e 69 78 20 66 69 |esent in| Unix fi|
|00003d70| 6c 65 73 79 73 74 65 6d | 73 2e 0a 0a 46 69 6c 65 |lesystem|s...File|
|00003d80| 20 61 74 74 72 69 62 75 | 74 65 73 20 61 6c 6c 6f | attribu|tes allo|
|00003d90| 77 20 74 68 65 20 75 73 | 65 72 73 20 74 6f 20 6d |w the us|ers to m|
|00003da0| 6f 64 69 66 79 20 74 68 | 65 20 6b 65 72 6e 65 6c |odify th|e kernel|
|00003db0| 20 62 65 68 61 76 69 6f | 72 20 77 68 65 6e 20 61 | behavio|r when a|
|00003dc0| 63 74 69 6e 67 0a 6f 6e | 20 61 20 73 65 74 20 6f |cting.on| a set o|
|00003dd0| 66 20 66 69 6c 65 73 2e | 20 4f 6e 65 20 63 61 6e |f files.| One can|
|00003de0| 20 73 65 74 20 61 74 74 | 72 69 62 75 74 65 73 20 | set att|ributes |
|00003df0| 6f 6e 20 61 20 66 69 6c | 65 20 6f 72 20 6f 6e 20 |on a fil|e or on |
|00003e00| 61 20 64 69 72 65 63 74 | 6f 72 79 2e 20 49 6e 0a |a direct|ory. In.|
|00003e10| 74 68 65 20 6c 61 74 65 | 72 20 63 61 73 65 2c 20 |the late|r case, |
|00003e20| 6e 65 77 20 66 69 6c 65 | 73 20 63 72 65 61 74 65 |new file|s create|
|00003e30| 64 20 69 6e 20 74 68 65 | 20 64 69 72 65 63 74 6f |d in the| directo|
|00003e40| 72 79 20 69 6e 68 65 72 | 69 74 20 74 68 65 73 65 |ry inher|it these|
|00003e50| 20 61 74 74 72 69 62 75 | 74 65 73 2e 0a 0a 42 53 | attribu|tes...BS|
|00003e60| 44 20 6f 72 20 53 79 73 | 74 65 6d 20 56 20 52 65 |D or Sys|tem V Re|
|00003e70| 6c 65 61 73 65 20 34 20 | 73 65 6d 61 6e 74 69 63 |lease 4 |semantic|
|00003e80| 73 20 63 61 6e 20 62 65 | 20 73 65 6c 65 63 74 65 |s can be| selecte|
|00003e90| 64 20 61 74 20 6d 6f 75 | 6e 74 20 74 69 6d 65 2e |d at mou|nt time.|
|00003ea0| 0a 41 20 6d 6f 75 6e 74 | 20 6f 70 74 69 6f 6e 20 |.A mount| option |
|00003eb0| 61 6c 6c 6f 77 73 0a 74 | 68 65 20 61 64 6d 69 6e |allows.t|he admin|
|00003ec0| 69 73 74 72 61 74 6f 72 | 20 74 6f 20 63 68 6f 6f |istrator| to choo|
|00003ed0| 73 65 20 74 68 65 20 66 | 69 6c 65 20 63 72 65 61 |se the f|ile crea|
|00003ee0| 74 69 6f 6e 20 73 65 6d | 61 6e 74 69 63 73 2e 20 |tion sem|antics. |
|00003ef0| 4f 6e 20 61 20 66 69 6c | 65 73 79 73 74 65 6d 0a |On a fil|esystem.|
|00003f00| 6d 6f 75 6e 74 65 64 20 | 77 69 74 68 20 42 53 44 |mounted |with BSD|
|00003f10| 20 73 65 6d 61 6e 74 69 | 63 73 2c 20 66 69 6c 65 | semanti|cs, file|
|00003f20| 73 20 61 72 65 20 63 72 | 65 61 74 65 64 20 77 69 |s are cr|eated wi|
|00003f30| 74 68 20 74 68 65 20 73 | 61 6d 65 20 67 72 6f 75 |th the s|ame grou|
|00003f40| 70 20 69 64 20 61 73 0a | 74 68 65 69 72 20 70 61 |p id as.|their pa|
|00003f50| 72 65 6e 74 20 64 69 72 | 65 63 74 6f 72 79 2e 20 |rent dir|ectory. |
|00003f60| 53 79 73 74 65 6d 20 56 | 20 73 65 6d 61 6e 74 69 |System V| semanti|
|00003f70| 63 73 20 61 72 65 20 61 | 20 62 69 74 20 6d 6f 72 |cs are a| bit mor|
|00003f80| 65 20 63 6f 6d 70 6c 65 | 78 3a 0a 69 66 20 61 20 |e comple|x:.if a |
|00003f90| 64 69 72 65 63 74 6f 72 | 79 20 68 61 73 20 74 68 |director|y has th|
|00003fa0| 65 20 73 65 74 67 69 64 | 20 62 69 74 20 73 65 74 |e setgid| bit set|
|00003fb0| 2c 20 6e 65 77 20 66 69 | 6c 65 73 20 69 6e 68 65 |, new fi|les inhe|
|00003fc0| 72 69 74 20 74 68 65 20 | 67 72 6f 75 70 20 69 64 |rit the |group id|
|00003fd0| 0a 6f 66 20 74 68 65 20 | 64 69 72 65 63 74 6f 72 |.of the |director|
|00003fe0| 79 20 61 6e 64 20 73 75 | 62 64 69 72 65 63 74 6f |y and su|bdirecto|
|00003ff0| 72 69 65 73 20 69 6e 68 | 65 72 69 74 20 74 68 65 |ries inh|erit the|
|00004000| 20 67 72 6f 75 70 20 69 | 64 20 61 6e 64 20 74 68 | group i|d and th|
|00004010| 65 20 73 65 74 67 69 64 | 20 62 69 74 3b 0a 69 6e |e setgid| bit;.in|
|00004020| 20 74 68 65 20 6f 74 68 | 65 72 20 63 61 73 65 2c | the oth|er case,|
|00004030| 20 66 69 6c 65 73 20 61 | 6e 64 20 73 75 62 64 69 | files a|nd subdi|
|00004040| 72 65 63 74 6f 72 69 65 | 73 20 61 72 65 20 63 72 |rectorie|s are cr|
|00004050| 65 61 74 65 64 20 77 69 | 74 68 20 74 68 65 0a 70 |eated wi|th the.p|
|00004060| 72 69 6d 61 72 79 20 67 | 72 6f 75 70 20 69 64 20 |rimary g|roup id |
|00004070| 6f 66 20 74 68 65 20 63 | 61 6c 6c 69 6e 67 20 70 |of the c|alling p|
|00004080| 72 6f 63 65 73 73 2e 0a | 0a 42 53 44 2d 6c 69 6b |rocess..|.BSD-lik|
|00004090| 65 20 73 79 6e 63 68 72 | 6f 6e 6f 75 73 20 75 70 |e synchr|onous up|
|000040a0| 64 61 74 65 73 20 63 61 | 6e 20 62 65 20 75 73 65 |dates ca|n be use|
|000040b0| 64 20 69 6e 20 45 78 74 | 32 66 73 2e 20 41 20 6d |d in Ext|2fs. A m|
|000040c0| 6f 75 6e 74 20 6f 70 74 | 69 6f 6e 20 61 6c 6c 6f |ount opt|ion allo|
|000040d0| 77 73 0a 74 68 65 20 61 | 64 6d 69 6e 69 73 74 72 |ws.the a|dministr|
|000040e0| 61 74 6f 72 20 74 6f 20 | 72 65 71 75 65 73 74 20 |ator to |request |
|000040f0| 74 68 61 74 20 6d 65 74 | 61 64 61 74 61 20 28 69 |that met|adata (i|
|00004100| 6e 6f 64 65 73 2c 20 62 | 69 74 6d 61 70 20 62 6c |nodes, b|itmap bl|
|00004110| 6f 63 6b 73 2c 20 69 6e | 64 69 72 65 63 74 0a 62 |ocks, in|direct.b|
|00004120| 6c 6f 63 6b 73 20 61 6e | 64 20 64 69 72 65 63 74 |locks an|d direct|
|00004130| 6f 72 79 20 62 6c 6f 63 | 6b 73 29 20 62 65 20 77 |ory bloc|ks) be w|
|00004140| 72 69 74 74 65 6e 20 73 | 79 6e 63 68 72 6f 6e 6f |ritten s|ynchrono|
|00004150| 75 73 6c 79 20 6f 6e 20 | 74 68 65 20 64 69 73 6b |usly on |the disk|
|00004160| 20 77 68 65 6e 20 74 68 | 65 79 0a 61 72 65 20 6d | when th|ey.are m|
|00004170| 6f 64 69 66 69 65 64 2e | 20 54 68 69 73 20 63 61 |odified.| This ca|
|00004180| 6e 20 62 65 20 75 73 65 | 66 75 6c 20 74 6f 20 6d |n be use|ful to m|
|00004190| 61 69 6e 74 61 69 6e 20 | 61 20 73 74 72 69 63 74 |aintain |a strict|
|000041a0| 20 6d 65 74 61 64 61 74 | 61 20 63 6f 6e 73 69 73 | metadat|a consis|
|000041b0| 74 65 6e 63 79 0a 62 75 | 74 20 74 68 69 73 20 6c |tency.bu|t this l|
|000041c0| 65 61 64 73 20 74 6f 20 | 70 6f 6f 72 20 70 65 72 |eads to |poor per|
|000041d0| 66 6f 72 6d 61 6e 63 65 | 73 2e 20 41 63 74 75 61 |formance|s. Actua|
|000041e0| 6c 6c 79 2c 20 74 68 69 | 73 20 66 65 61 74 75 72 |lly, thi|s featur|
|000041f0| 65 20 69 73 20 6e 6f 74 | 0a 6e 6f 72 6d 61 6c 6c |e is not|.normall|
|00004200| 79 20 75 73 65 64 2c 20 | 73 69 6e 63 65 20 69 6e |y used, |since in|
|00004210| 20 61 64 64 69 74 69 6f | 6e 20 74 6f 20 74 68 65 | additio|n to the|
|00004220| 20 70 65 72 66 6f 72 6d | 61 6e 63 65 20 6c 6f 73 | perform|ance los|
|00004230| 73 20 61 73 73 6f 63 69 | 61 74 65 64 20 77 69 74 |s associ|ated wit|
|00004240| 68 0a 75 73 69 6e 67 20 | 73 79 6e 63 68 72 6f 6e |h.using |synchron|
|00004250| 6f 75 73 20 75 70 64 61 | 74 65 73 20 6f 66 20 74 |ous upda|tes of t|
|00004260| 68 65 20 6d 65 74 61 64 | 61 74 61 2c 20 69 74 20 |he metad|ata, it |
|00004270| 63 61 6e 20 63 61 75 73 | 65 20 63 6f 72 72 75 70 |can caus|e corrup|
|00004280| 74 69 6f 6e 20 69 6e 20 | 74 68 65 0a 75 73 65 72 |tion in |the.user|
|00004290| 20 64 61 74 61 20 77 68 | 69 63 68 20 77 69 6c 6c | data wh|ich will|
|000042a0| 20 6e 6f 74 20 62 65 20 | 66 6c 61 67 67 65 64 20 | not be |flagged |
|000042b0| 62 79 20 74 68 65 20 66 | 69 6c 65 73 79 73 74 65 |by the f|ilesyste|
|000042c0| 6d 20 63 68 65 63 6b 65 | 72 2e 0a 0a 45 78 74 32 |m checke|r...Ext2|
|000042d0| 66 73 20 61 6c 6c 6f 77 | 73 20 74 68 65 20 61 64 |fs allow|s the ad|
|000042e0| 6d 69 6e 69 73 74 72 61 | 74 6f 72 20 74 6f 20 63 |ministra|tor to c|
|000042f0| 68 6f 6f 73 65 20 74 68 | 65 20 6c 6f 67 69 63 61 |hoose th|e logica|
|00004300| 6c 20 62 6c 6f 63 6b 20 | 73 69 7a 65 20 77 68 65 |l block |size whe|
|00004310| 6e 20 63 72 65 61 74 69 | 6e 67 0a 74 68 65 20 66 |n creati|ng.the f|
|00004320| 69 6c 65 73 79 73 74 65 | 6d 2e 20 42 6c 6f 63 6b |ilesyste|m. Block|
|00004330| 20 73 69 7a 65 73 20 63 | 61 6e 20 74 79 70 69 63 | sizes c|an typic|
|00004340| 61 6c 6c 79 20 62 65 20 | 31 30 32 34 2c 20 32 30 |ally be |1024, 20|
|00004350| 34 38 20 61 6e 64 20 34 | 30 39 36 20 62 79 74 65 |48 and 4|096 byte|
|00004360| 73 2e 0a 55 73 69 6e 67 | 20 62 69 67 20 62 6c 6f |s..Using| big blo|
|00004370| 63 6b 20 73 69 7a 65 73 | 20 63 61 6e 20 73 70 65 |ck sizes| can spe|
|00004380| 65 64 20 75 70 20 49 2f | 4f 20 73 69 6e 63 65 20 |ed up I/|O since |
|00004390| 66 65 77 65 72 20 49 2f | 4f 20 72 65 71 75 65 73 |fewer I/|O reques|
|000043a0| 74 73 2c 20 61 6e 64 20 | 74 68 75 73 0a 66 65 77 |ts, and |thus.few|
|000043b0| 65 72 20 64 69 73 6b 20 | 68 65 61 64 20 73 65 65 |er disk |head see|
|000043c0| 6b 73 2c 20 6e 65 65 64 | 20 74 6f 20 62 65 20 64 |ks, need| to be d|
|000043d0| 6f 6e 65 20 74 6f 20 61 | 63 63 65 73 73 20 61 20 |one to a|ccess a |
|000043e0| 66 69 6c 65 2e 20 4f 6e | 20 74 68 65 20 6f 74 68 |file. On| the oth|
|000043f0| 65 72 20 68 61 6e 64 2c | 20 62 69 67 0a 62 6c 6f |er hand,| big.blo|
|00004400| 63 6b 73 20 77 61 73 74 | 65 20 6d 6f 72 65 20 64 |cks wast|e more d|
|00004410| 69 73 6b 20 73 70 61 63 | 65 3a 20 6f 6e 20 74 68 |isk spac|e: on th|
|00004420| 65 20 61 76 65 72 61 67 | 65 2c 20 74 68 65 20 6c |e averag|e, the l|
|00004430| 61 73 74 20 62 6c 6f 63 | 6b 20 61 6c 6c 6f 63 61 |ast bloc|k alloca|
|00004440| 74 65 64 20 74 6f 0a 61 | 20 66 69 6c 65 20 69 73 |ted to.a| file is|
|00004450| 20 6f 6e 6c 79 20 68 61 | 6c 66 20 66 75 6c 6c 2c | only ha|lf full,|
|00004460| 20 73 6f 20 61 73 20 62 | 6c 6f 63 6b 73 20 67 65 | so as b|locks ge|
|00004470| 74 20 62 69 67 67 65 72 | 2c 20 6d 6f 72 65 20 73 |t bigger|, more s|
|00004480| 70 61 63 65 20 69 73 20 | 77 61 73 74 65 64 20 69 |pace is |wasted i|
|00004490| 6e 0a 74 68 65 20 6c 61 | 73 74 20 62 6c 6f 63 6b |n.the la|st block|
|000044a0| 20 6f 66 20 65 61 63 68 | 20 66 69 6c 65 2e 20 49 | of each| file. I|
|000044b0| 6e 20 61 64 64 69 74 69 | 6f 6e 2c 20 6d 6f 73 74 |n additi|on, most|
|000044c0| 20 6f 66 20 74 68 65 20 | 61 64 76 61 6e 74 61 67 | of the |advantag|
|000044d0| 65 73 20 6f 66 0a 6c 61 | 72 67 65 72 20 62 6c 6f |es of.la|rger blo|
|000044e0| 63 6b 20 73 69 7a 65 73 | 20 61 72 65 20 6f 62 74 |ck sizes| are obt|
|000044f0| 61 69 6e 65 64 20 62 79 | 20 45 78 74 32 20 66 69 |ained by| Ext2 fi|
|00004500| 6c 65 73 79 73 74 65 6d | 27 73 20 70 72 65 61 6c |lesystem|'s preal|
|00004510| 6c 6f 63 61 74 69 6f 6e | 0a 74 65 63 68 6e 69 71 |location|.techniq|
|00004520| 75 65 73 20 28 73 65 65 | 20 73 65 63 74 69 6f 6e |ues (see| section|
|00004530| 7e 5c 72 65 66 20 7b 73 | 75 62 73 65 63 74 69 6f |~\ref {s|ubsectio|
|00004540| 6e 3a 65 78 74 32 66 73 | 3a 61 6c 6c 6f 63 61 74 |n:ext2fs|:allocat|
|00004550| 69 6f 6e 7d 29 2e 0a 0a | 45 78 74 32 66 73 20 69 |ion})...|Ext2fs i|
|00004560| 6d 70 6c 65 6d 65 6e 74 | 73 20 66 61 73 74 20 73 |mplement|s fast s|
|00004570| 79 6d 62 6f 6c 69 63 20 | 6c 69 6e 6b 73 2e 20 41 |ymbolic |links. A|
|00004580| 20 66 61 73 74 20 73 79 | 6d 62 6f 6c 69 63 20 6c | fast sy|mbolic l|
|00004590| 69 6e 6b 20 64 6f 65 73 | 20 6e 6f 74 20 75 73 65 |ink does| not use|
|000045a0| 20 61 6e 79 0a 64 61 74 | 61 20 62 6c 6f 63 6b 20 | any.dat|a block |
|000045b0| 6f 6e 20 74 68 65 20 66 | 69 6c 65 73 79 73 74 65 |on the f|ilesyste|
|000045c0| 6d 2e 20 54 68 65 20 74 | 61 72 67 65 74 20 6e 61 |m. The t|arget na|
|000045d0| 6d 65 20 69 73 20 6e 6f | 74 20 73 74 6f 72 65 64 |me is no|t stored|
|000045e0| 20 69 6e 20 61 20 64 61 | 74 61 20 62 6c 6f 63 6b | in a da|ta block|
|000045f0| 0a 62 75 74 20 69 6e 20 | 74 68 65 20 69 6e 6f 64 |.but in |the inod|
|00004600| 65 20 69 74 73 65 6c 66 | 2e 20 54 68 69 73 20 70 |e itself|. This p|
|00004610| 6f 6c 69 63 79 20 63 61 | 6e 20 73 61 76 65 20 73 |olicy ca|n save s|
|00004620| 6f 6d 65 20 64 69 73 6b | 20 73 70 61 63 65 20 28 |ome disk| space (|
|00004630| 6e 6f 20 64 61 74 61 20 | 62 6c 6f 63 6b 0a 6e 65 |no data |block.ne|
|00004640| 65 64 73 20 74 6f 20 62 | 65 20 61 6c 6c 6f 63 61 |eds to b|e alloca|
|00004650| 74 65 64 29 20 61 6e 64 | 20 73 70 65 65 64 73 20 |ted) and| speeds |
|00004660| 75 70 20 6c 69 6e 6b 20 | 6f 70 65 72 61 74 69 6f |up link |operatio|
|00004670| 6e 73 20 28 74 68 65 72 | 65 20 69 73 20 6e 6f 20 |ns (ther|e is no |
|00004680| 6e 65 65 64 20 74 6f 0a | 72 65 61 64 20 61 20 64 |need to.|read a d|
|00004690| 61 74 61 20 62 6c 6f 63 | 6b 20 77 68 65 6e 20 61 |ata bloc|k when a|
|000046a0| 63 63 65 73 73 69 6e 67 | 20 73 75 63 68 20 61 20 |ccessing| such a |
|000046b0| 6c 69 6e 6b 29 2e 20 4f | 66 20 63 6f 75 72 73 65 |link). O|f course|
|000046c0| 2c 20 74 68 65 20 73 70 | 61 63 65 0a 61 76 61 69 |, the sp|ace.avai|
|000046d0| 6c 61 62 6c 65 20 69 6e | 20 74 68 65 0a 69 6e 6f |lable in| the.ino|
|000046e0| 64 65 20 69 73 20 6c 69 | 6d 69 74 65 64 20 73 6f |de is li|mited so|
|000046f0| 20 6e 6f 74 20 65 76 65 | 72 79 20 6c 69 6e 6b 20 | not eve|ry link |
|00004700| 63 61 6e 20 62 65 20 69 | 6d 70 6c 65 6d 65 6e 74 |can be i|mplement|
|00004710| 65 64 20 61 73 20 61 20 | 66 61 73 74 20 73 79 6d |ed as a |fast sym|
|00004720| 62 6f 6c 69 63 20 6c 69 | 6e 6b 2e 0a 54 68 65 20 |bolic li|nk..The |
|00004730| 6d 61 78 69 6d 61 6c 20 | 73 69 7a 65 20 6f 66 20 |maximal |size of |
|00004740| 74 68 65 20 74 61 72 67 | 65 74 20 6e 61 6d 65 20 |the targ|et name |
|00004750| 69 6e 20 61 20 66 61 73 | 74 20 73 79 6d 62 6f 6c |in a fas|t symbol|
|00004760| 69 63 20 6c 69 6e 6b 20 | 69 73 20 36 30 20 63 68 |ic link |is 60 ch|
|00004770| 61 72 61 63 74 65 72 73 | 2e 0a 57 65 20 70 6c 61 |aracters|..We pla|
|00004780| 6e 20 74 6f 20 65 78 74 | 65 6e 64 20 74 68 69 73 |n to ext|end this|
|00004790| 20 73 63 68 65 6d 65 20 | 74 6f 20 73 6d 61 6c 6c | scheme |to small|
|000047a0| 20 66 69 6c 65 73 20 69 | 6e 20 61 20 6e 65 61 72 | files i|n a near|
|000047b0| 20 66 75 74 75 72 65 2e | 0a 0a 45 78 74 32 66 73 | future.|..Ext2fs|
|000047c0| 20 6b 65 65 70 73 20 74 | 72 61 63 6b 20 6f 66 20 | keeps t|rack of |
|000047d0| 74 68 65 20 66 69 6c 65 | 73 79 73 74 65 6d 20 73 |the file|system s|
|000047e0| 74 61 74 65 2e 20 41 20 | 73 70 65 63 69 61 6c 20 |tate. A |special |
|000047f0| 66 69 65 6c 64 20 69 6e | 20 74 68 65 0a 73 75 70 |field in| the.sup|
|00004800| 65 72 62 6c 6f 63 6b 20 | 69 73 20 75 73 65 64 20 |erblock |is used |
|00004810| 62 79 20 74 68 65 20 6b | 65 72 6e 65 6c 20 63 6f |by the k|ernel co|
|00004820| 64 65 20 74 6f 20 69 6e | 64 69 63 61 74 65 20 74 |de to in|dicate t|
|00004830| 68 65 20 73 74 61 74 75 | 73 20 6f 66 20 74 68 65 |he statu|s of the|
|00004840| 20 66 69 6c 65 0a 73 79 | 73 74 65 6d 2e 20 57 68 | file.sy|stem. Wh|
|00004850| 65 6e 20 61 20 66 69 6c | 65 73 79 73 74 65 6d 20 |en a fil|esystem |
|00004860| 69 73 20 6d 6f 75 6e 74 | 65 64 20 69 6e 20 72 65 |is mount|ed in re|
|00004870| 61 64 2f 77 72 69 74 65 | 20 6d 6f 64 65 2c 20 69 |ad/write| mode, i|
|00004880| 74 73 20 73 74 61 74 65 | 0a 69 73 20 73 65 74 20 |ts state|.is set |
|00004890| 74 6f 20 60 60 4e 6f 74 | 20 43 6c 65 61 6e 27 27 |to ``Not| Clean''|
|000048a0| 2e 20 57 68 65 6e 20 69 | 74 20 69 73 20 75 6e 6d |. When i|t is unm|
|000048b0| 6f 75 6e 74 65 64 20 6f | 72 20 72 65 6d 6f 75 6e |ounted o|r remoun|
|000048c0| 74 65 64 20 69 6e 20 72 | 65 61 64 2d 6f 6e 6c 79 |ted in r|ead-only|
|000048d0| 0a 6d 6f 64 65 2c 20 69 | 74 73 20 73 74 61 74 65 |.mode, i|ts state|
|000048e0| 20 69 73 20 72 65 73 65 | 74 20 74 6f 20 60 60 43 | is rese|t to ``C|
|000048f0| 6c 65 61 6e 27 27 2e 20 | 41 74 20 62 6f 6f 74 20 |lean''. |At boot |
|00004900| 74 69 6d 65 2c 20 74 68 | 65 20 66 69 6c 65 73 79 |time, th|e filesy|
|00004910| 73 74 65 6d 0a 63 68 65 | 63 6b 65 72 20 75 73 65 |stem.che|cker use|
|00004920| 73 20 74 68 69 73 0a 69 | 6e 66 6f 72 6d 61 74 69 |s this.i|nformati|
|00004930| 6f 6e 20 74 6f 20 64 65 | 63 69 64 65 20 69 66 20 |on to de|cide if |
|00004940| 61 20 66 69 6c 65 73 79 | 73 74 65 6d 20 6d 75 73 |a filesy|stem mus|
|00004950| 74 20 62 65 20 63 68 65 | 63 6b 65 64 2e 0a 54 68 |t be che|cked..Th|
|00004960| 65 20 6b 65 72 6e 65 6c | 20 63 6f 64 65 20 61 6c |e kernel| code al|
|00004970| 73 6f 20 72 65 63 6f 72 | 64 73 20 65 72 72 6f 72 |so recor|ds error|
|00004980| 73 20 69 6e 20 74 68 69 | 73 20 66 69 65 6c 64 2e |s in thi|s field.|
|00004990| 20 57 68 65 6e 20 61 6e | 20 69 6e 63 6f 6e 73 69 | When an| inconsi|
|000049a0| 73 74 65 6e 63 79 0a 69 | 73 20 64 65 74 65 63 74 |stency.i|s detect|
|000049b0| 65 64 20 62 79 20 74 68 | 65 20 6b 65 72 6e 65 6c |ed by th|e kernel|
|000049c0| 20 63 6f 64 65 2c 0a 74 | 68 65 20 66 69 6c 65 73 | code,.t|he files|
|000049d0| 79 73 74 65 6d 20 69 73 | 20 6d 61 72 6b 65 64 20 |ystem is| marked |
|000049e0| 61 73 20 60 60 45 72 72 | 6f 6e 65 6f 75 73 27 27 |as ``Err|oneous''|
|000049f0| 2e 20 54 68 65 20 66 69 | 6c 65 73 79 73 74 65 6d |. The fi|lesystem|
|00004a00| 0a 63 68 65 63 6b 65 72 | 20 74 65 73 74 73 20 74 |.checker| tests t|
|00004a10| 68 69 73 20 74 6f 20 66 | 6f 72 63 65 20 74 68 65 |his to f|orce the|
|00004a20| 20 63 68 65 63 6b 20 6f | 66 20 74 68 65 20 66 69 | check o|f the fi|
|00004a30| 6c 65 73 79 73 74 65 6d | 20 72 65 67 61 72 64 6c |lesystem| regardl|
|00004a40| 65 73 73 20 6f 66 0a 69 | 74 73 20 61 70 70 61 72 |ess of.i|ts appar|
|00004a50| 65 6e 74 6c 79 20 63 6c | 65 61 6e 20 73 74 61 74 |ently cl|ean stat|
|00004a60| 65 2e 0a 0a 41 6c 77 61 | 79 73 20 73 6b 69 70 70 |e...Alwa|ys skipp|
|00004a70| 69 6e 67 20 66 69 6c 65 | 73 79 73 74 65 6d 20 63 |ing file|system c|
|00004a80| 68 65 63 6b 73 20 6d 61 | 79 20 73 6f 6d 65 74 69 |hecks ma|y someti|
|00004a90| 6d 65 73 20 62 65 20 64 | 61 6e 67 65 72 6f 75 73 |mes be d|angerous|
|00004aa0| 0a 73 6f 20 45 78 74 32 | 66 73 20 70 72 6f 76 69 |.so Ext2|fs provi|
|00004ab0| 64 65 73 0a 74 77 6f 20 | 77 61 79 73 20 74 6f 20 |des.two |ways to |
|00004ac0| 66 6f 72 63 65 20 63 68 | 65 63 6b 73 20 61 74 20 |force ch|ecks at |
|00004ad0| 72 65 67 75 6c 61 72 20 | 69 6e 74 65 72 76 61 6c |regular |interval|
|00004ae0| 73 2e 20 41 20 6d 6f 75 | 6e 74 20 63 6f 75 6e 74 |s. A mou|nt count|
|00004af0| 65 72 20 69 73 20 6d 61 | 69 6e 74 61 69 6e 65 64 |er is ma|intained|
|00004b00| 0a 69 6e 20 74 68 65 20 | 73 75 70 65 72 62 6c 6f |.in the |superblo|
|00004b10| 63 6b 2e 20 45 61 63 68 | 20 74 69 6d 65 20 74 68 |ck. Each| time th|
|00004b20| 65 20 66 69 6c 65 73 79 | 73 74 65 6d 20 69 73 20 |e filesy|stem is |
|00004b30| 6d 6f 75 6e 74 65 64 20 | 69 6e 20 72 65 61 64 2f |mounted |in read/|
|00004b40| 77 72 69 74 65 20 6d 6f | 64 65 2c 0a 74 68 69 73 |write mo|de,.this|
|00004b50| 20 63 6f 75 6e 74 65 72 | 20 69 73 20 69 6e 63 72 | counter| is incr|
|00004b60| 65 6d 65 6e 74 65 64 2e | 20 57 68 65 6e 20 69 74 |emented.| When it|
|00004b70| 20 72 65 61 63 68 65 73 | 20 61 20 6d 61 78 69 6d | reaches| a maxim|
|00004b80| 61 6c 20 76 61 6c 75 65 | 20 28 61 6c 73 6f 20 72 |al value| (also r|
|00004b90| 65 63 6f 72 64 65 64 0a | 69 6e 20 74 68 65 20 73 |ecorded.|in the s|
|00004ba0| 75 70 65 72 62 6c 6f 63 | 6b 29 2c 20 74 68 65 20 |uperbloc|k), the |
|00004bb0| 66 69 6c 65 73 79 73 74 | 65 6d 20 63 68 65 63 6b |filesyst|em check|
|00004bc0| 65 72 20 66 6f 72 63 65 | 73 20 74 68 65 20 63 68 |er force|s the ch|
|00004bd0| 65 63 6b 20 65 76 65 6e | 20 69 66 20 74 68 65 0a |eck even| if the.|
|00004be0| 66 69 6c 65 73 79 73 74 | 65 6d 20 69 73 20 60 60 |filesyst|em is ``|
|00004bf0| 43 6c 65 61 6e 27 27 2e | 20 41 20 6c 61 73 74 20 |Clean''.| A last |
|00004c00| 63 68 65 63 6b 20 74 69 | 6d 65 20 61 6e 64 20 61 |check ti|me and a|
|00004c10| 20 6d 61 78 69 6d 61 6c | 20 63 68 65 63 6b 20 69 | maximal| check i|
|00004c20| 6e 74 65 72 76 61 6c 20 | 61 72 65 0a 61 6c 73 6f |nterval |are.also|
|00004c30| 20 6d 61 69 6e 74 61 69 | 6e 65 64 20 69 6e 20 74 | maintai|ned in t|
|00004c40| 68 65 20 73 75 70 65 72 | 62 6c 6f 63 6b 2e 20 54 |he super|block. T|
|00004c50| 68 65 73 65 20 74 77 6f | 20 66 69 65 6c 64 73 20 |hese two| fields |
|00004c60| 61 6c 6c 6f 77 20 74 68 | 65 20 61 64 6d 69 6e 69 |allow th|e admini|
|00004c70| 73 74 72 61 74 6f 72 0a | 74 6f 20 72 65 71 75 65 |strator.|to reque|
|00004c80| 73 74 20 70 65 72 69 6f | 64 69 63 61 6c 20 63 68 |st perio|dical ch|
|00004c90| 65 63 6b 73 2e 20 57 68 | 65 6e 20 74 68 65 20 6d |ecks. Wh|en the m|
|00004ca0| 61 78 69 6d 61 6c 20 63 | 68 65 63 6b 20 69 6e 74 |aximal c|heck int|
|00004cb0| 65 72 76 61 6c 20 68 61 | 73 20 62 65 65 6e 20 72 |erval ha|s been r|
|00004cc0| 65 61 63 68 65 64 2c 0a | 74 68 65 20 63 68 65 63 |eached,.|the chec|
|00004cd0| 6b 65 72 20 69 67 6e 6f | 72 65 73 20 74 68 65 20 |ker igno|res the |
|00004ce0| 66 69 6c 65 73 79 73 74 | 65 6d 20 73 74 61 74 65 |filesyst|em state|
|00004cf0| 20 61 6e 64 20 66 6f 72 | 63 65 73 20 61 20 66 69 | and for|ces a fi|
|00004d00| 6c 65 73 79 73 74 65 6d | 20 63 68 65 63 6b 2e 0a |lesystem| check..|
|00004d10| 0a 45 78 74 32 66 73 20 | 6f 66 66 65 72 73 20 74 |.Ext2fs |offers t|
|00004d20| 6f 6f 6c 73 20 74 6f 20 | 74 75 6e 65 20 74 68 65 |ools to |tune the|
|00004d30| 20 66 69 6c 65 73 79 73 | 74 65 6d 20 62 65 68 61 | filesys|tem beha|
|00004d40| 76 69 6f 72 2e 0a 54 68 | 65 20 7b 5c 74 74 20 74 |vior..Th|e {\tt t|
|00004d50| 75 6e 65 32 66 73 7d 20 | 70 72 6f 67 72 61 6d 20 |une2fs} |program |
|00004d60| 63 61 6e 20 62 65 20 75 | 73 65 64 20 74 6f 20 6d |can be u|sed to m|
|00004d70| 6f 64 69 66 79 3a 0a 5c | 62 65 67 69 6e 20 7b 69 |odify:.\|begin {i|
|00004d80| 74 65 6d 69 7a 65 7d 0a | 5c 6d 79 69 74 65 6d 20 |temize}.|\myitem |
|00004d90| 74 68 65 20 65 72 72 6f | 72 20 62 65 68 61 76 69 |the erro|r behavi|
|00004da0| 6f 72 2e 20 57 68 65 6e | 20 61 6e 20 69 6e 63 6f |or. When| an inco|
|00004db0| 6e 73 69 73 74 65 6e 63 | 79 20 69 73 20 64 65 74 |nsistenc|y is det|
|00004dc0| 65 63 74 65 64 20 62 79 | 20 74 68 65 20 6b 65 72 |ected by| the ker|
|00004dd0| 6e 65 6c 0a 63 6f 64 65 | 2c 20 74 68 65 20 66 69 |nel.code|, the fi|
|00004de0| 6c 65 73 79 73 74 65 6d | 20 69 73 20 6d 61 72 6b |lesystem| is mark|
|00004df0| 65 64 20 61 73 20 60 60 | 45 72 72 6f 6e 65 6f 75 |ed as ``|Erroneou|
|00004e00| 73 27 27 20 61 6e 64 20 | 6f 6e 65 20 6f 66 20 74 |s'' and |one of t|
|00004e10| 68 65 20 74 68 72 65 65 | 0a 66 6f 6c 6c 6f 77 69 |he three|.followi|
|00004e20| 6e 67 20 61 63 74 69 6f | 6e 73 20 63 61 6e 20 62 |ng actio|ns can b|
|00004e30| 65 20 64 6f 6e 65 3a 20 | 63 6f 6e 74 69 6e 75 65 |e done: |continue|
|00004e40| 20 6e 6f 72 6d 61 6c 20 | 65 78 65 63 75 74 69 6f | normal |executio|
|00004e50| 6e 2c 0a 72 65 6d 6f 75 | 6e 74 20 74 68 65 20 66 |n,.remou|nt the f|
|00004e60| 69 6c 65 73 79 73 74 65 | 6d 20 69 6e 20 72 65 61 |ilesyste|m in rea|
|00004e70| 64 2d 6f 6e 6c 79 20 6d | 6f 64 65 20 74 6f 20 61 |d-only m|ode to a|
|00004e80| 76 6f 69 64 20 63 6f 72 | 72 75 70 74 69 6e 67 20 |void cor|rupting |
|00004e90| 74 68 65 0a 66 69 6c 65 | 73 79 73 74 65 6d 2c 0a |the.file|system,.|
|00004ea0| 6d 61 6b 65 20 74 68 65 | 20 6b 65 72 6e 65 6c 20 |make the| kernel |
|00004eb0| 70 61 6e 69 63 20 61 6e | 64 20 72 65 62 6f 6f 74 |panic an|d reboot|
|00004ec0| 20 74 6f 20 72 75 6e 20 | 74 68 65 20 66 69 6c 65 | to run |the file|
|00004ed0| 73 79 73 74 65 6d 20 63 | 68 65 63 6b 65 72 2e 0a |system c|hecker..|
|00004ee0| 5c 6d 79 69 74 65 6d 20 | 74 68 65 20 6d 61 78 69 |\myitem |the maxi|
|00004ef0| 6d 61 6c 20 6d 6f 75 6e | 74 20 63 6f 75 6e 74 2e |mal moun|t count.|
|00004f00| 0a 5c 6d 79 69 74 65 6d | 20 74 68 65 20 6d 61 78 |.\myitem| the max|
|00004f10| 69 6d 61 6c 20 63 68 65 | 63 6b 20 69 6e 74 65 72 |imal che|ck inter|
|00004f20| 76 61 6c 2e 0a 5c 6d 79 | 69 74 65 6d 20 74 68 65 |val..\my|item the|
|00004f30| 20 6e 75 6d 62 65 72 20 | 6f 66 20 6c 6f 67 69 63 | number |of logic|
|00004f40| 61 6c 20 62 6c 6f 63 6b | 73 20 72 65 73 65 72 76 |al block|s reserv|
|00004f50| 65 64 20 66 6f 72 20 74 | 68 65 20 73 75 70 65 72 |ed for t|he super|
|00004f60| 20 75 73 65 72 2e 0a 5c | 65 6e 64 20 7b 69 74 65 | user..\|end {ite|
|00004f70| 6d 69 7a 65 7d 0a 0a 4d | 6f 75 6e 74 20 6f 70 74 |mize}..M|ount opt|
|00004f80| 69 6f 6e 73 20 63 61 6e | 20 61 6c 73 6f 20 62 65 |ions can| also be|
|00004f90| 20 75 73 65 64 20 74 6f | 20 63 68 61 6e 67 65 20 | used to| change |
|00004fa0| 74 68 65 20 6b 65 72 6e | 65 6c 20 65 72 72 6f 72 |the kern|el error|
|00004fb0| 20 62 65 68 61 76 69 6f | 72 2e 0a 0a 41 6e 20 61 | behavio|r...An a|
|00004fc0| 74 74 72 69 62 75 74 65 | 20 61 6c 6c 6f 77 73 20 |ttribute| allows |
|00004fd0| 74 68 65 20 75 73 65 72 | 73 0a 74 6f 20 72 65 71 |the user|s.to req|
|00004fe0| 75 65 73 74 20 73 65 63 | 75 72 65 20 64 65 6c 65 |uest sec|ure dele|
|00004ff0| 74 69 6f 6e 20 6f 6e 20 | 66 69 6c 65 73 2e 20 57 |tion on |files. W|
|00005000| 68 65 6e 20 73 75 63 68 | 20 61 20 66 69 6c 65 20 |hen such| a file |
|00005010| 69 73 20 64 65 6c 65 74 | 65 64 2c 20 72 61 6e 64 |is delet|ed, rand|
|00005020| 6f 6d 20 64 61 74 61 0a | 69 73 20 77 72 69 74 74 |om data.|is writt|
|00005030| 65 6e 20 69 6e 20 74 68 | 65 20 64 69 73 6b 20 62 |en in th|e disk b|
|00005040| 6c 6f 63 6b 73 20 70 72 | 65 76 69 6f 75 73 6c 79 |locks pr|eviously|
|00005050| 20 61 6c 6c 6f 63 61 74 | 65 64 20 74 6f 20 74 68 | allocat|ed to th|
|00005060| 65 20 66 69 6c 65 2e 20 | 54 68 69 73 20 70 72 65 |e file. |This pre|
|00005070| 76 65 6e 74 73 0a 6d 61 | 6c 69 63 69 6f 75 73 20 |vents.ma|licious |
|00005080| 70 65 6f 70 6c 65 20 66 | 72 6f 6d 20 67 61 69 6e |people f|rom gain|
|00005090| 69 6e 67 20 61 63 63 65 | 73 73 20 74 6f 20 74 68 |ing acce|ss to th|
|000050a0| 65 20 70 72 65 76 69 6f | 75 73 20 63 6f 6e 74 65 |e previo|us conte|
|000050b0| 6e 74 20 6f 66 20 74 68 | 65 20 66 69 6c 65 20 62 |nt of th|e file b|
|000050c0| 79 0a 75 73 69 6e 67 20 | 61 20 64 69 73 6b 20 65 |y.using |a disk e|
|000050d0| 64 69 74 6f 72 2e 0a 0a | 4c 61 73 74 2c 20 6e 65 |ditor...|Last, ne|
|000050e0| 77 20 74 79 70 65 73 20 | 6f 66 20 66 69 6c 65 73 |w types |of files|
|000050f0| 20 69 6e 73 70 69 72 65 | 64 20 66 72 6f 6d 20 74 | inspire|d from t|
|00005100| 68 65 20 34 2e 34 20 42 | 53 44 20 66 69 6c 65 73 |he 4.4 B|SD files|
|00005110| 79 73 74 65 6d 20 68 61 | 76 65 20 72 65 63 65 6e |ystem ha|ve recen|
|00005120| 74 6c 79 0a 62 65 65 6e | 20 61 64 64 65 64 20 74 |tly.been| added t|
|00005130| 6f 20 45 78 74 32 66 73 | 2e 20 49 6d 6d 75 74 61 |o Ext2fs|. Immuta|
|00005140| 62 6c 65 20 66 69 6c 65 | 73 20 63 61 6e 20 6f 6e |ble file|s can on|
|00005150| 6c 79 20 62 65 20 72 65 | 61 64 3a 20 6e 6f 62 6f |ly be re|ad: nobo|
|00005160| 64 79 20 63 61 6e 20 77 | 72 69 74 65 20 6f 72 0a |dy can w|rite or.|
|00005170| 64 65 6c 65 74 65 20 74 | 68 65 6d 2e 20 54 68 69 |delete t|hem. Thi|
|00005180| 73 20 63 61 6e 20 62 65 | 20 75 73 65 64 20 74 6f |s can be| used to|
|00005190| 20 70 72 6f 74 65 63 74 | 20 73 65 6e 73 69 74 69 | protect| sensiti|
|000051a0| 76 65 20 63 6f 6e 66 69 | 67 75 72 61 74 69 6f 6e |ve confi|guration|
|000051b0| 20 66 69 6c 65 73 2e 0a | 41 70 70 65 6e 64 2d 6f | files..|Append-o|
|000051c0| 6e 6c 79 20 66 69 6c 65 | 73 20 63 61 6e 20 62 65 |nly file|s can be|
|000051d0| 20 6f 70 65 6e 65 64 20 | 69 6e 20 77 72 69 74 65 | opened |in write|
|000051e0| 20 6d 6f 64 65 20 62 75 | 74 20 64 61 74 61 20 69 | mode bu|t data i|
|000051f0| 73 20 61 6c 77 61 79 73 | 20 61 70 70 65 6e 64 65 |s always| appende|
|00005200| 64 0a 61 74 20 74 68 65 | 20 65 6e 64 20 6f 66 20 |d.at the| end of |
|00005210| 74 68 65 20 66 69 6c 65 | 2e 20 4c 69 6b 65 20 69 |the file|. Like i|
|00005220| 6d 6d 75 74 61 62 6c 65 | 20 66 69 6c 65 73 2c 20 |mmutable| files, |
|00005230| 74 68 65 79 20 63 61 6e | 6e 6f 74 20 62 65 20 64 |they can|not be d|
|00005240| 65 6c 65 74 65 64 20 6f | 72 0a 72 65 6e 61 6d 65 |eleted o|r.rename|
|00005250| 64 2e 20 54 68 69 73 20 | 69 73 20 65 73 70 65 63 |d. This |is espec|
|00005260| 69 61 6c 6c 79 20 75 73 | 65 66 75 6c 20 66 6f 72 |ially us|eful for|
|00005270| 20 6c 6f 67 20 66 69 6c | 65 73 20 77 68 69 63 68 | log fil|es which|
|00005280| 20 63 61 6e 20 6f 6e 6c | 79 20 67 72 6f 77 2e 0a | can onl|y grow..|
|00005290| 0a 5c 73 75 62 73 65 63 | 74 69 6f 6e 20 7b 50 68 |.\subsec|tion {Ph|
|000052a0| 79 73 69 63 61 6c 20 53 | 74 72 75 63 74 75 72 65 |ysical S|tructure|
|000052b0| 7d 0a 5c 6c 61 62 65 6c | 20 7b 73 75 62 73 65 63 |}.\label| {subsec|
|000052c0| 74 69 6f 6e 3a 65 78 74 | 32 66 73 3a 73 74 72 75 |tion:ext|2fs:stru|
|000052d0| 63 74 75 72 65 7d 0a 0a | 09 54 68 65 20 70 68 79 |cture}..|.The phy|
|000052e0| 73 69 63 61 6c 20 73 74 | 72 75 63 74 75 72 65 20 |sical st|ructure |
|000052f0| 6f 66 20 45 78 74 32 20 | 66 69 6c 65 73 79 73 74 |of Ext2 |filesyst|
|00005300| 65 6d 73 20 68 61 73 20 | 62 65 65 6e 20 73 74 72 |ems has |been str|
|00005310| 6f 6e 67 6c 79 0a 69 6e | 66 6c 75 65 6e 63 65 64 |ongly.in|fluenced|
|00005320| 20 62 79 20 74 68 65 20 | 6c 61 79 6f 75 74 20 6f | by the |layout o|
|00005330| 66 20 74 68 65 20 42 53 | 44 20 66 69 6c 65 73 79 |f the BS|D filesy|
|00005340| 73 74 65 6d 20 5c 63 69 | 74 65 20 7b 6d 63 6b 75 |stem \ci|te {mcku|
|00005350| 73 69 63 6b 3a 66 66 73 | 7d 2e 20 41 0a 66 69 6c |sick:ffs|}. A.fil|
|00005360| 65 73 79 73 74 65 6d 20 | 69 73 20 6d 61 64 65 20 |esystem |is made |
|00005370| 75 70 20 6f 66 20 62 6c | 6f 63 6b 20 67 72 6f 75 |up of bl|ock grou|
|00005380| 70 73 2e 20 42 6c 6f 63 | 6b 0a 67 72 6f 75 70 73 |ps. Bloc|k.groups|
|00005390| 20 61 72 65 20 61 6e 61 | 6c 6f 67 6f 75 73 20 74 | are ana|logous t|
|000053a0| 6f 20 42 53 44 20 46 46 | 53 27 73 20 63 79 6c 69 |o BSD FF|S's cyli|
|000053b0| 6e 64 65 72 20 67 72 6f | 75 70 73 2e 20 48 6f 77 |nder gro|ups. How|
|000053c0| 65 76 65 72 2c 20 62 6c | 6f 63 6b 20 67 72 6f 75 |ever, bl|ock grou|
|000053d0| 70 73 0a 61 72 65 20 6e | 6f 74 20 74 69 65 64 20 |ps.are n|ot tied |
|000053e0| 74 6f 20 74 68 65 20 70 | 68 79 73 69 63 61 6c 20 |to the p|hysical |
|000053f0| 6c 61 79 6f 75 74 20 6f | 66 20 74 68 65 20 62 6c |layout o|f the bl|
|00005400| 6f 63 6b 73 20 6f 6e 20 | 74 68 65 20 64 69 73 6b |ocks on |the disk|
|00005410| 2c 20 73 69 6e 63 65 20 | 6d 6f 64 65 72 6e 0a 64 |, since |modern.d|
|00005420| 72 69 76 65 73 20 74 65 | 6e 64 20 74 6f 20 62 65 |rives te|nd to be|
|00005430| 20 6f 70 74 69 6d 69 7a | 65 64 20 66 6f 72 20 73 | optimiz|ed for s|
|00005440| 65 71 75 65 6e 74 69 61 | 6c 20 61 63 63 65 73 73 |equentia|l access|
|00005450| 20 61 6e 64 20 68 69 64 | 65 20 74 68 65 69 72 20 | and hid|e their |
|00005460| 70 68 79 73 69 63 61 6c | 0a 67 65 6f 6d 65 74 72 |physical|.geometr|
|00005470| 79 20 74 6f 20 74 68 65 | 20 6f 70 65 72 61 74 69 |y to the| operati|
|00005480| 6e 67 20 73 79 73 74 65 | 6d 2e 0a 0a 54 68 65 20 |ng syste|m...The |
|00005490| 70 68 79 73 69 63 61 6c | 20 73 74 72 75 63 74 75 |physical| structu|
|000054a0| 72 65 20 6f 66 20 61 20 | 66 69 6c 65 73 79 73 74 |re of a |filesyst|
|000054b0| 65 6d 20 69 73 20 72 65 | 70 72 65 73 65 6e 74 65 |em is re|presente|
|000054c0| 64 20 6f 6e 0a 66 69 67 | 75 72 65 7e 5c 72 65 66 |d on.fig|ure~\ref|
|000054d0| 20 7b 66 69 67 3a 65 78 | 74 32 66 73 2f 73 74 72 | {fig:ex|t2fs/str|
|000054e0| 75 63 74 75 72 65 7d 2e | 0a 0a 5c 62 65 67 69 6e |ucture}.|..\begin|
|000054f0| 20 7b 66 69 67 75 72 65 | 7d 20 5b 68 74 62 70 5d | {figure|} [htbp]|
|00005500| 0a 5c 62 65 67 69 6e 20 | 7b 63 65 6e 74 65 72 7d |.\begin |{center}|
|00005510| 0a 5c 62 65 67 69 6e 20 | 7b 74 61 62 75 6c 61 72 |.\begin |{tabular|
|00005520| 7d 20 7b 7c 63 7c 63 7c | 63 7c 63 7c 63 7c 7d 20 |} {|c|c||c|c|c|} |
|00005530| 5c 68 6c 69 6e 65 0a 42 | 6f 6f 74 09 26 20 42 6c |\hline.B|oot.& Bl|
|00005540| 6f 63 6b 09 09 26 20 42 | 6c 6f 63 6b 09 09 26 20 |ock..& B|lock..& |
|00005550| 2e 2e 2e 09 26 20 42 6c | 6f 63 6b 20 5c 5c 0a 53 |....& Bl|ock \\.S|
|00005560| 65 63 74 6f 72 09 26 20 | 47 72 6f 75 70 20 31 09 |ector.& |Group 1.|
|00005570| 26 20 47 72 6f 75 70 20 | 32 09 26 20 2e 2e 2e 09 |& Group |2.& ....|
|00005580| 26 20 47 72 6f 75 70 20 | 4e 20 5c 5c 20 5c 68 6c |& Group |N \\ \hl|
|00005590| 69 6e 65 0a 5c 65 6e 64 | 20 7b 74 61 62 75 6c 61 |ine.\end| {tabula|
|000055a0| 72 7d 0a 5c 65 6e 64 20 | 7b 63 65 6e 74 65 72 7d |r}.\end |{center}|
|000055b0| 0a 5c 63 61 70 74 69 6f | 6e 20 7b 50 68 79 73 69 |.\captio|n {Physi|
|000055c0| 63 61 6c 20 73 74 72 75 | 63 74 75 72 65 20 6f 66 |cal stru|cture of|
|000055d0| 20 61 6e 20 45 78 74 32 | 20 66 69 6c 65 73 79 73 | an Ext2| filesys|
|000055e0| 74 65 6d 7d 0a 5c 6c 61 | 62 65 6c 20 7b 66 69 67 |tem}.\la|bel {fig|
|000055f0| 3a 65 78 74 32 66 73 2f | 73 74 72 75 63 74 75 72 |:ext2fs/|structur|
|00005600| 65 7d 0a 5c 65 6e 64 20 | 7b 66 69 67 75 72 65 7d |e}.\end |{figure}|
|00005610| 0a 0a 09 45 61 63 68 20 | 62 6c 6f 63 6b 20 67 72 |...Each |block gr|
|00005620| 6f 75 70 20 63 6f 6e 74 | 61 69 6e 73 20 61 20 72 |oup cont|ains a r|
|00005630| 65 64 75 6e 64 61 6e 74 | 20 63 6f 70 79 20 6f 66 |edundant| copy of|
|00005640| 20 63 72 75 63 69 61 6c | 20 66 69 6c 65 73 79 73 | crucial| filesys|
|00005650| 74 65 6d 0a 63 6f 6e 74 | 72 6f 6c 20 69 6e 66 6f |tem.cont|rol info|
|00005660| 72 6d 61 74 69 6f 6e 73 | 20 28 73 75 70 65 72 62 |rmations| (superb|
|00005670| 6c 6f 63 6b 20 61 6e 64 | 20 74 68 65 20 66 69 6c |lock and| the fil|
|00005680| 65 73 79 73 74 65 6d 20 | 64 65 73 63 72 69 70 74 |esystem |descript|
|00005690| 6f 72 73 29 20 61 6e 64 | 0a 61 6c 73 6f 20 63 6f |ors) and|.also co|
|000056a0| 6e 74 61 69 6e 73 20 61 | 20 70 61 72 74 20 6f 66 |ntains a| part of|
|000056b0| 20 74 68 65 20 66 69 6c | 65 73 79 73 74 65 6d 20 | the fil|esystem |
|000056c0| 28 61 20 62 6c 6f 63 6b | 20 62 69 74 6d 61 70 2c |(a block| bitmap,|
|000056d0| 20 61 6e 20 69 6e 6f 64 | 65 0a 62 69 74 6d 61 70 | an inod|e.bitmap|
|000056e0| 2c 20 61 20 70 69 65 63 | 65 20 6f 66 20 74 68 65 |, a piec|e of the|
|000056f0| 20 69 6e 6f 64 65 20 74 | 61 62 6c 65 2c 20 61 6e | inode t|able, an|
|00005700| 64 20 64 61 74 61 20 62 | 6c 6f 63 6b 73 29 2e 20 |d data b|locks). |
|00005710| 54 68 65 20 73 74 72 75 | 63 74 75 72 65 20 6f 66 |The stru|cture of|
|00005720| 0a 61 20 62 6c 6f 63 6b | 20 67 72 6f 75 70 20 69 |.a block| group i|
|00005730| 73 20 72 65 70 72 65 73 | 65 6e 74 65 64 20 6f 6e |s repres|ented on|
|00005740| 20 66 69 67 75 72 65 7e | 5c 72 65 66 7b 66 69 67 | figure~|\ref{fig|
|00005750| 3a 65 78 74 32 66 73 2f | 67 72 6f 75 70 7d 2e 0a |:ext2fs/|group}..|
|00005760| 0a 5c 62 65 67 69 6e 20 | 7b 66 69 67 75 72 65 7d |.\begin |{figure}|
|00005770| 20 5b 68 74 62 70 5d 0a | 5c 62 65 67 69 6e 20 7b | [htbp].|\begin {|
|00005780| 63 65 6e 74 65 72 7d 0a | 5c 62 65 67 69 6e 20 7b |center}.|\begin {|
|00005790| 74 61 62 75 6c 61 72 7d | 20 7b 7c 63 7c 63 7c 63 |tabular}| {|c|c|c|
|000057a0| 7c 63 7c 63 7c 6c 7c 7d | 20 5c 68 6c 69 6e 65 0a ||c|c|l|}| \hline.|
|000057b0| 53 75 70 65 72 09 26 20 | 46 53 20 64 65 73 63 2d |Super.& |FS desc-|
|000057c0| 09 26 20 42 6c 6f 63 6b | 09 26 20 49 6e 6f 64 65 |.& Block|.& Inode|
|000057d0| 09 26 20 49 6e 6f 64 65 | 09 26 20 44 61 74 61 20 |.& Inode|.& Data |
|000057e0| 42 6c 6f 63 6b 73 20 5c | 5c 0a 42 6c 6f 63 6b 09 |Blocks \|\.Block.|
|000057f0| 26 20 72 69 70 74 6f 72 | 73 09 26 20 42 69 74 6d |& riptor|s.& Bitm|
|00005800| 61 70 26 20 42 69 74 6d | 61 70 26 20 54 61 62 6c |ap& Bitm|ap& Tabl|
|00005810| 65 09 26 09 5c 5c 20 5c | 68 6c 69 6e 65 0a 5c 65 |e.&.\\ \|hline.\e|
|00005820| 6e 64 20 7b 74 61 62 75 | 6c 61 72 7d 0a 5c 65 6e |nd {tabu|lar}.\en|
|00005830| 64 20 7b 63 65 6e 74 65 | 72 7d 0a 5c 63 61 70 74 |d {cente|r}.\capt|
|00005840| 69 6f 6e 20 7b 53 74 72 | 75 63 74 75 72 65 20 6f |ion {Str|ucture o|
|00005850| 66 20 61 20 62 6c 6f 63 | 6b 20 67 72 6f 75 70 7d |f a bloc|k group}|
|00005860| 0a 5c 6c 61 62 65 6c 20 | 7b 66 69 67 3a 65 78 74 |.\label |{fig:ext|
|00005870| 32 66 73 2f 67 72 6f 75 | 70 7d 0a 5c 65 6e 64 20 |2fs/grou|p}.\end |
|00005880| 7b 66 69 67 75 72 65 7d | 0a 0a 09 55 73 69 6e 67 |{figure}|...Using|
|00005890| 20 62 6c 6f 63 6b 20 67 | 72 6f 75 70 73 20 69 73 | block g|roups is|
|000058a0| 20 61 20 62 69 67 20 77 | 69 6e 20 69 6e 20 74 65 | a big w|in in te|
|000058b0| 72 6d 73 20 6f 66 20 72 | 65 6c 69 61 62 69 6c 69 |rms of r|eliabili|
|000058c0| 74 79 3a 0a 73 69 6e 63 | 65 20 74 68 65 20 63 6f |ty:.sinc|e the co|
|000058d0| 6e 74 72 6f 6c 20 73 74 | 72 75 63 74 75 72 65 73 |ntrol st|ructures|
|000058e0| 20 61 72 65 20 72 65 70 | 6c 69 63 61 74 65 64 20 | are rep|licated |
|000058f0| 69 6e 20 65 61 63 68 20 | 62 6c 6f 63 6b 0a 67 72 |in each |block.gr|
|00005900| 6f 75 70 2c 20 69 74 20 | 69 73 20 65 61 73 79 20 |oup, it |is easy |
|00005910| 74 6f 20 72 65 63 6f 76 | 65 72 20 66 72 6f 6d 20 |to recov|er from |
|00005920| 61 20 66 69 6c 65 73 79 | 73 74 65 6d 20 77 68 65 |a filesy|stem whe|
|00005930| 72 65 20 74 68 65 20 73 | 75 70 65 72 62 6c 6f 63 |re the s|uperbloc|
|00005940| 6b 20 68 61 73 0a 62 65 | 65 6e 20 63 6f 72 72 75 |k has.be|en corru|
|00005950| 70 74 65 64 2e 20 54 68 | 69 73 20 73 74 72 75 63 |pted. Th|is struc|
|00005960| 74 75 72 65 20 61 6c 73 | 6f 20 68 65 6c 70 73 20 |ture als|o helps |
|00005970| 74 6f 20 67 65 74 20 67 | 6f 6f 64 20 70 65 72 66 |to get g|ood perf|
|00005980| 6f 72 6d 61 6e 63 65 73 | 3a 20 62 79 0a 72 65 64 |ormances|: by.red|
|00005990| 75 63 69 6e 67 20 74 68 | 65 20 64 69 73 74 61 6e |ucing th|e distan|
|000059a0| 63 65 20 62 65 74 77 65 | 65 6e 20 74 68 65 20 69 |ce betwe|en the i|
|000059b0| 6e 6f 64 65 20 74 61 62 | 6c 65 20 61 6e 64 20 74 |node tab|le and t|
|000059c0| 68 65 20 64 61 74 61 20 | 62 6c 6f 63 6b 73 2c 20 |he data |blocks, |
|000059d0| 69 74 20 69 73 0a 70 6f | 73 73 69 62 6c 65 20 74 |it is.po|ssible t|
|000059e0| 6f 20 72 65 64 75 63 65 | 20 74 68 65 20 64 69 73 |o reduce| the dis|
|000059f0| 6b 20 68 65 61 64 20 73 | 65 65 6b 73 20 64 75 72 |k head s|eeks dur|
|00005a00| 69 6e 67 20 49 2f 4f 20 | 6f 6e 20 66 69 6c 65 73 |ing I/O |on files|
|00005a10| 2e 0a 0a 09 49 6e 20 45 | 78 74 32 66 73 2c 20 64 |....In E|xt2fs, d|
|00005a20| 69 72 65 63 74 6f 72 69 | 65 73 20 61 72 65 20 6d |irectori|es are m|
|00005a30| 61 6e 61 67 65 64 20 61 | 73 20 6c 69 6e 6b 65 64 |anaged a|s linked|
|00005a40| 20 6c 69 73 74 73 20 6f | 66 20 76 61 72 69 61 62 | lists o|f variab|
|00005a50| 6c 65 0a 6c 65 6e 67 74 | 68 20 65 6e 74 72 69 65 |le.lengt|h entrie|
|00005a60| 73 2e 20 45 61 63 68 20 | 65 6e 74 72 79 20 63 6f |s. Each |entry co|
|00005a70| 6e 74 61 69 6e 73 20 74 | 68 65 20 69 6e 6f 64 65 |ntains t|he inode|
|00005a80| 20 6e 75 6d 62 65 72 2c | 20 74 68 65 20 65 6e 74 | number,| the ent|
|00005a90| 72 79 20 6c 65 6e 67 74 | 68 2c 0a 74 68 65 20 66 |ry lengt|h,.the f|
|00005aa0| 69 6c 65 20 6e 61 6d 65 | 20 61 6e 64 20 69 74 73 |ile name| and its|
|00005ab0| 20 6c 65 6e 67 74 68 2e | 20 42 79 20 75 73 69 6e | length.| By usin|
|00005ac0| 67 0a 76 61 72 69 61 62 | 6c 65 20 6c 65 6e 67 74 |g.variab|le lengt|
|00005ad0| 68 20 65 6e 74 72 69 65 | 73 2c 20 69 74 20 69 73 |h entrie|s, it is|
|00005ae0| 20 70 6f 73 73 69 62 6c | 65 20 74 6f 20 69 6d 70 | possibl|e to imp|
|00005af0| 6c 65 6d 65 6e 74 20 6c | 6f 6e 67 20 66 69 6c 65 |lement l|ong file|
|00005b00| 20 6e 61 6d 65 73 20 77 | 69 74 68 6f 75 74 0a 77 | names w|ithout.w|
|00005b10| 61 73 74 69 6e 67 20 64 | 69 73 6b 20 73 70 61 63 |asting d|isk spac|
|00005b20| 65 20 69 6e 20 64 69 72 | 65 63 74 6f 72 69 65 73 |e in dir|ectories|
|00005b30| 2e 20 54 68 65 20 73 74 | 72 75 63 74 75 72 65 20 |. The st|ructure |
|00005b40| 6f 66 20 61 20 64 69 72 | 65 63 74 6f 72 79 20 65 |of a dir|ectory e|
|00005b50| 6e 74 72 79 0a 69 73 20 | 73 68 6f 77 6e 20 6f 6e |ntry.is |shown on|
|00005b60| 20 66 69 67 75 72 65 7e | 5c 72 65 66 20 7b 66 69 | figure~|\ref {fi|
|00005b70| 67 3a 65 78 74 32 66 73 | 2f 64 69 72 2d 65 6e 74 |g:ext2fs|/dir-ent|
|00005b80| 72 79 7d 2e 0a 0a 5c 62 | 65 67 69 6e 20 7b 66 69 |ry}...\b|egin {fi|
|00005b90| 67 75 72 65 7d 20 5b 68 | 74 62 70 5d 0a 5c 62 65 |gure} [h|tbp].\be|
|00005ba0| 67 69 6e 7b 63 65 6e 74 | 65 72 7d 0a 5c 62 65 67 |gin{cent|er}.\beg|
|00005bb0| 69 6e 20 7b 74 61 62 75 | 6c 61 72 7d 20 7b 7c 6c |in {tabu|lar} {|l|
|00005bc0| 7c 6c 7c 6c 7c 6c 7c 7d | 20 5c 68 6c 69 6e 65 0a ||l|l|l|}| \hline.|
|00005bd0| 69 6e 6f 64 65 20 6e 75 | 6d 62 65 72 09 26 20 65 |inode nu|mber.& e|
|00005be0| 6e 74 72 79 20 6c 65 6e | 67 74 68 09 26 20 6e 61 |ntry len|gth.& na|
|00005bf0| 6d 65 20 6c 65 6e 67 74 | 68 09 26 20 66 69 6c 65 |me lengt|h.& file|
|00005c00| 6e 61 6d 65 20 5c 5c 20 | 5c 68 6c 69 6e 65 0a 5c |name \\ |\hline.\|
|00005c10| 65 6e 64 20 7b 74 61 62 | 75 6c 61 72 7d 0a 5c 65 |end {tab|ular}.\e|
|00005c20| 6e 64 20 7b 63 65 6e 74 | 65 72 7d 0a 5c 63 61 70 |nd {cent|er}.\cap|
|00005c30| 74 69 6f 6e 20 7b 53 74 | 72 75 63 74 75 72 65 20 |tion {St|ructure |
|00005c40| 6f 66 20 61 20 64 69 72 | 65 63 74 6f 72 79 20 65 |of a dir|ectory e|
|00005c50| 6e 74 72 79 7d 0a 5c 6c | 61 62 65 6c 20 7b 66 69 |ntry}.\l|abel {fi|
|00005c60| 67 3a 65 78 74 32 66 73 | 2f 64 69 72 2d 65 6e 74 |g:ext2fs|/dir-ent|
|00005c70| 72 79 7d 0a 5c 65 6e 64 | 20 7b 66 69 67 75 72 65 |ry}.\end| {figure|
|00005c80| 7d 0a 0a 09 41 73 20 61 | 6e 20 65 78 61 6d 70 6c |}...As a|n exampl|
|00005c90| 65 2c 20 66 69 67 75 72 | 65 7e 5c 72 65 66 20 7b |e, figur|e~\ref {|
|00005ca0| 66 69 67 3a 65 78 74 32 | 66 73 2f 64 69 72 2d 65 |fig:ext2|fs/dir-e|
|00005cb0| 78 7d 20 72 65 70 72 65 | 73 65 6e 74 73 20 74 68 |x} repre|sents th|
|00005cc0| 65 20 73 74 72 75 63 74 | 75 72 65 0a 6f 66 20 61 |e struct|ure.of a|
|00005cd0| 20 64 69 72 65 63 74 6f | 72 79 20 63 6f 6e 74 61 | directo|ry conta|
|00005ce0| 69 6e 69 6e 67 20 74 68 | 72 65 65 20 66 69 6c 65 |ining th|ree file|
|00005cf0| 73 3a 20 7b 5c 74 74 20 | 66 69 6c 65 31 7d 2c 20 |s: {\tt |file1}, |
|00005d00| 7b 5c 74 74 20 6c 6f 6e | 67 5c 5f 66 69 6c 65 5c |{\tt lon|g\_file\|
|00005d10| 5f 6e 61 6d 65 7d 2c 0a | 61 6e 64 20 7b 5c 74 74 |_name},.|and {\tt|
|00005d20| 20 66 32 7d 2e 0a 0a 5c | 62 65 67 69 6e 20 7b 66 | f2}...\|begin {f|
|00005d30| 69 67 75 72 65 7d 20 5b | 68 74 62 70 5d 0a 5c 62 |igure} [|htbp].\b|
|00005d40| 65 67 69 6e 20 7b 74 61 | 62 75 6c 61 72 7d 20 7b |egin {ta|bular} {|
|00005d50| 7c 6c 7c 6c 7c 6c 7c 6c | 7c 7d 20 5c 68 6c 69 6e ||l|l|l|l||} \hlin|
|00005d60| 65 0a 69 31 20 26 20 31 | 36 20 26 20 30 35 20 26 |e.i1 & 1|6 & 05 &|
|00005d70| 20 7b 5c 74 74 20 66 69 | 6c 65 31 7e 7e 7e 7d 20 | {\tt fi|le1~~~} |
|00005d80| 5c 5c 20 5c 68 6c 69 6e | 65 0a 5c 65 6e 64 20 7b |\\ \hlin|e.\end {|
|00005d90| 74 61 62 75 6c 61 72 7d | 0a 5c 62 65 67 69 6e 20 |tabular}|.\begin |
|00005da0| 7b 74 61 62 75 6c 61 72 | 7d 20 7b 7c 6c 7c 6c 7c |{tabular|} {|l|l||
|00005db0| 6c 7c 6c 7c 7d 20 5c 68 | 6c 69 6e 65 0a 69 32 20 |l|l|} \h|line.i2 |
|00005dc0| 26 20 34 30 20 26 20 31 | 34 20 26 20 7b 5c 74 74 |& 40 & 1|4 & {\tt|
|00005dd0| 20 6c 6f 6e 67 5c 5f 66 | 69 6c 65 5c 5f 6e 61 6d | long\_f|ile\_nam|
|00005de0| 65 7e 7e 7d 20 5c 5c 20 | 5c 68 6c 69 6e 65 0a 5c |e~~} \\ |\hline.\|
|00005df0| 65 6e 64 20 7b 74 61 62 | 75 6c 61 72 7d 0a 5c 62 |end {tab|ular}.\b|
|00005e00| 65 67 69 6e 20 7b 74 61 | 62 75 6c 61 72 7d 20 7b |egin {ta|bular} {|
|00005e10| 7c 6c 7c 6c 7c 6c 7c 6c | 7c 7d 20 5c 68 6c 69 6e ||l|l|l|l||} \hlin|
|00005e20| 65 0a 69 33 20 26 20 31 | 32 20 26 20 30 32 20 26 |e.i3 & 1|2 & 02 &|
|00005e30| 20 7b 5c 74 74 20 66 32 | 7e 7e 7d 20 5c 5c 20 5c | {\tt f2|~~} \\ \|
|00005e40| 68 6c 69 6e 65 0a 5c 65 | 6e 64 20 7b 74 61 62 75 |hline.\e|nd {tabu|
|00005e50| 6c 61 72 7d 0a 5c 63 61 | 70 74 69 6f 6e 20 7b 45 |lar}.\ca|ption {E|
|00005e60| 78 61 6d 70 6c 65 20 6f | 66 20 64 69 72 65 63 74 |xample o|f direct|
|00005e70| 6f 72 79 7d 0a 5c 6c 61 | 62 65 6c 20 7b 66 69 67 |ory}.\la|bel {fig|
|00005e80| 3a 65 78 74 32 66 73 2f | 64 69 72 2d 65 78 7d 0a |:ext2fs/|dir-ex}.|
|00005e90| 5c 65 6e 64 20 7b 66 69 | 67 75 72 65 7d 0a 0a 5c |\end {fi|gure}..\|
|00005ea0| 73 75 62 73 65 63 74 69 | 6f 6e 20 7b 50 65 72 66 |subsecti|on {Perf|
|00005eb0| 6f 72 6d 61 6e 63 65 20 | 6f 70 74 69 6d 69 7a 61 |ormance |optimiza|
|00005ec0| 74 69 6f 6e 73 7d 0a 5c | 6c 61 62 65 6c 20 7b 73 |tions}.\|label {s|
|00005ed0| 75 62 73 65 63 74 69 6f | 6e 3a 65 78 74 32 66 73 |ubsectio|n:ext2fs|
|00005ee0| 3a 61 6c 6c 6f 63 61 74 | 69 6f 6e 7d 0a 0a 09 54 |:allocat|ion}...T|
|00005ef0| 68 65 20 45 78 74 32 66 | 73 20 6b 65 72 6e 65 6c |he Ext2f|s kernel|
|00005f00| 20 63 6f 64 65 20 63 6f | 6e 74 61 69 6e 73 20 6d | code co|ntains m|
|00005f10| 61 6e 79 20 70 65 72 66 | 6f 72 6d 61 6e 63 65 20 |any perf|ormance |
|00005f20| 6f 70 74 69 6d 69 7a 61 | 74 69 6f 6e 73 2c 20 77 |optimiza|tions, w|
|00005f30| 68 69 63 68 0a 74 65 6e | 64 20 74 6f 20 69 6d 70 |hich.ten|d to imp|
|00005f40| 72 6f 76 65 20 49 2f 4f | 20 73 70 65 65 64 20 77 |rove I/O| speed w|
|00005f50| 68 65 6e 20 72 65 61 64 | 69 6e 67 20 61 6e 64 20 |hen read|ing and |
|00005f60| 77 72 69 74 69 6e 67 20 | 66 69 6c 65 73 2e 0a 0a |writing |files...|
|00005f70| 09 45 78 74 32 66 73 20 | 74 61 6b 65 73 20 61 64 |.Ext2fs |takes ad|
|00005f80| 76 61 6e 74 61 67 65 20 | 6f 66 20 74 68 65 20 62 |vantage |of the b|
|00005f90| 75 66 66 65 72 20 63 61 | 63 68 65 20 6d 61 6e 61 |uffer ca|che mana|
|00005fa0| 67 65 6d 65 6e 74 20 62 | 79 20 70 65 72 66 6f 72 |gement b|y perfor|
|00005fb0| 6d 69 6e 67 0a 72 65 61 | 64 61 68 65 61 64 73 3a |ming.rea|daheads:|
|00005fc0| 20 77 68 65 6e 20 61 20 | 62 6c 6f 63 6b 20 68 61 | when a |block ha|
|00005fd0| 73 20 74 6f 20 62 65 20 | 72 65 61 64 2c 20 74 68 |s to be |read, th|
|00005fe0| 65 20 6b 65 72 6e 65 6c | 20 63 6f 64 65 20 72 65 |e kernel| code re|
|00005ff0| 71 75 65 73 74 73 20 74 | 68 65 20 49 2f 4f 0a 6f |quests t|he I/O.o|
|00006000| 6e 20 73 65 76 65 72 61 | 6c 20 63 6f 6e 74 69 67 |n severa|l contig|
|00006010| 75 6f 75 73 20 62 6c 6f | 63 6b 73 2e 20 54 68 69 |uous blo|cks. Thi|
|00006020| 73 20 77 61 79 2c 20 69 | 74 20 74 72 69 65 73 20 |s way, i|t tries |
|00006030| 74 6f 20 65 6e 73 75 72 | 65 20 74 68 61 74 0a 74 |to ensur|e that.t|
|00006040| 68 65 20 6e 65 78 74 20 | 62 6c 6f 63 6b 20 74 6f |he next |block to|
|00006050| 20 72 65 61 64 20 77 69 | 6c 6c 20 61 6c 72 65 61 | read wi|ll alrea|
|00006060| 64 79 20 62 65 20 6c 6f | 61 64 65 64 20 69 6e 74 |dy be lo|aded int|
|00006070| 6f 20 74 68 65 20 62 75 | 66 66 65 72 20 63 61 63 |o the bu|ffer cac|
|00006080| 68 65 2e 20 52 65 61 64 | 61 68 65 61 64 73 0a 61 |he. Read|aheads.a|
|00006090| 72 65 20 6e 6f 72 6d 61 | 6c 6c 79 20 70 65 72 66 |re norma|lly perf|
|000060a0| 6f 72 6d 65 64 20 64 75 | 72 69 6e 67 20 73 65 71 |ormed du|ring seq|
|000060b0| 75 65 6e 74 69 61 6c 20 | 72 65 61 64 73 20 6f 6e |uential |reads on|
|000060c0| 20 66 69 6c 65 73 20 61 | 6e 64 20 45 78 74 32 66 | files a|nd Ext2f|
|000060d0| 73 20 65 78 74 65 6e 64 | 73 0a 74 68 65 6d 20 74 |s extend|s.them t|
|000060e0| 6f 0a 64 69 72 65 63 74 | 6f 72 79 20 72 65 61 64 |o.direct|ory read|
|000060f0| 73 2c 20 65 69 74 68 65 | 72 20 65 78 70 6c 69 63 |s, eithe|r explic|
|00006100| 69 74 20 72 65 61 64 73 | 20 28 7b 5c 74 74 20 72 |it reads| ({\tt r|
|00006110| 65 61 64 64 69 72 28 32 | 29 7d 20 63 61 6c 6c 73 |eaddir(2|)} calls|
|00006120| 29 20 6f 72 20 69 6d 70 | 6c 69 63 69 74 0a 6f 6e |) or imp|licit.on|
|00006130| 65 73 20 28 7b 5c 74 74 | 20 6e 61 6d 65 69 7d 20 |es ({\tt| namei} |
|00006140| 6b 65 72 6e 65 6c 20 64 | 69 72 65 63 74 6f 72 79 |kernel d|irectory|
|00006150| 20 6c 6f 6f 6b 75 70 29 | 2e 0a 0a 09 45 78 74 32 | lookup)|....Ext2|
|00006160| 66 73 20 61 6c 73 6f 20 | 63 6f 6e 74 61 69 6e 73 |fs also |contains|
|00006170| 20 6d 61 6e 79 20 61 6c | 6c 6f 63 61 74 69 6f 6e | many al|location|
|00006180| 20 6f 70 74 69 6d 69 7a | 61 74 69 6f 6e 73 2e 20 | optimiz|ations. |
|00006190| 42 6c 6f 63 6b 20 67 72 | 6f 75 70 73 20 61 72 65 |Block gr|oups are|
|000061a0| 0a 75 73 65 64 20 74 6f | 20 63 6c 75 73 74 65 72 |.used to| cluster|
|000061b0| 20 74 6f 67 65 74 68 65 | 72 20 72 65 6c 61 74 65 | togethe|r relate|
|000061c0| 64 20 69 6e 6f 64 65 73 | 20 61 6e 64 20 64 61 74 |d inodes| and dat|
|000061d0| 61 3a 20 74 68 65 20 6b | 65 72 6e 65 6c 20 63 6f |a: the k|ernel co|
|000061e0| 64 65 20 61 6c 77 61 79 | 73 20 74 72 69 65 73 0a |de alway|s tries.|
|000061f0| 74 6f 20 61 6c 6c 6f 63 | 61 74 65 20 64 61 74 61 |to alloc|ate data|
|00006200| 20 62 6c 6f 63 6b 73 20 | 66 6f 72 20 61 20 66 69 | blocks |for a fi|
|00006210| 6c 65 20 69 6e 20 74 68 | 65 20 73 61 6d 65 20 67 |le in th|e same g|
|00006220| 72 6f 75 70 20 61 73 20 | 69 74 73 20 69 6e 6f 64 |roup as |its inod|
|00006230| 65 2e 20 54 68 69 73 20 | 69 73 0a 69 6e 74 65 6e |e. This |is.inten|
|00006240| 64 65 64 20 74 6f 20 72 | 65 64 75 63 65 20 74 68 |ded to r|educe th|
|00006250| 65 20 64 69 73 6b 20 68 | 65 61 64 20 73 65 65 6b |e disk h|ead seek|
|00006260| 73 20 6d 61 64 65 20 77 | 68 65 6e 20 74 68 65 20 |s made w|hen the |
|00006270| 6b 65 72 6e 65 6c 20 72 | 65 61 64 73 20 61 6e 20 |kernel r|eads an |
|00006280| 69 6e 6f 64 65 0a 61 6e | 64 20 69 74 73 20 64 61 |inode.an|d its da|
|00006290| 74 61 20 62 6c 6f 63 6b | 73 2e 0a 0a 09 57 68 65 |ta block|s....Whe|
|000062a0| 6e 20 77 72 69 74 69 6e | 67 20 64 61 74 61 20 74 |n writin|g data t|
|000062b0| 6f 20 61 20 66 69 6c 65 | 2c 20 45 78 74 32 66 73 |o a file|, Ext2fs|
|000062c0| 20 70 72 65 61 6c 6c 6f | 63 61 74 65 73 20 75 70 | preallo|cates up|
|000062d0| 20 74 6f 20 38 20 61 64 | 6a 61 63 65 6e 74 0a 62 | to 8 ad|jacent.b|
|000062e0| 6c 6f 63 6b 73 20 77 68 | 65 6e 20 61 6c 6c 6f 63 |locks wh|en alloc|
|000062f0| 61 74 69 6e 67 20 61 20 | 6e 65 77 20 62 6c 6f 63 |ating a |new bloc|
|00006300| 6b 2e 20 50 72 65 61 6c | 6c 6f 63 61 74 69 6f 6e |k. Preal|location|
|00006310| 20 68 69 74 20 72 61 74 | 65 73 20 61 72 65 20 61 | hit rat|es are a|
|00006320| 72 6f 75 6e 64 0a 37 35 | 5c 25 20 65 76 65 6e 20 |round.75|\% even |
|00006330| 6f 6e 20 76 65 72 79 20 | 66 75 6c 6c 20 66 69 6c |on very |full fil|
|00006340| 65 73 79 73 74 65 6d 73 | 2e 0a 54 68 69 73 20 70 |esystems|..This p|
|00006350| 72 65 61 6c 6c 6f 63 61 | 74 69 6f 6e 20 61 63 68 |realloca|tion ach|
|00006360| 69 65 76 65 73 20 67 6f | 6f 64 0a 77 72 69 74 65 |ieves go|od.write|
|00006370| 20 70 65 72 66 6f 72 6d | 61 6e 63 65 73 20 75 6e | perform|ances un|
|00006380| 64 65 72 20 68 65 61 76 | 79 20 6c 6f 61 64 2e 20 |der heav|y load. |
|00006390| 49 74 20 61 6c 73 6f 20 | 61 6c 6c 6f 77 73 20 63 |It also |allows c|
|000063a0| 6f 6e 74 69 67 75 6f 75 | 73 20 62 6c 6f 63 6b 73 |ontiguou|s blocks|
|000063b0| 20 74 6f 0a 62 65 20 61 | 6c 6c 6f 63 61 74 65 64 | to.be a|llocated|
|000063c0| 20 74 6f 20 66 69 6c 65 | 73 2c 20 74 68 75 73 20 | to file|s, thus |
|000063d0| 69 74 20 73 70 65 65 64 | 73 20 75 70 20 74 68 65 |it speed|s up the|
|000063e0| 20 66 75 74 75 72 65 20 | 73 65 71 75 65 6e 74 69 | future |sequenti|
|000063f0| 61 6c 20 72 65 61 64 73 | 2e 0a 0a 09 54 68 65 73 |al reads|....Thes|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.